CRUD Laravel 4 how to link to destroy?

前端 未结 9 1411
你的背包
你的背包 2020-12-08 07:46

I will destroy my user with a HTML link, but it doesn\'t seem to generate the correct link, what am i doing wrong?

public function destroy($id)
{
    //Slet          


        
9条回答
  •  遥遥无期
    2020-12-08 08:05

    For those looking to create delete button using anchor tag in laravel 5.

    {!! Form::open(['action' => ['UserController@destroy', $user->id], 'method' => 'DELETE', 'name' => 'post_' . md5($user->id . $user->created_at)]) !!}
        
            
        
    {!! Form::close() !!}
    

提交回复
热议问题