laravel 5.8 delete/destroy id from database

Posted 1 month ago by PaulCatalin97

how can be done? i can`t find any solution on documentation.

this is the controller

public function destroy ($id)
    {
        Joburi::destroy($id);
        return redirect()->route('listajoburi.update');
    }

this is the button

<a href="{{route('listajoburi.destroy',$row['id'])}}" class="btn btn-danger">Delete</a>
                            <form method="post" class="delete_form" action="{{route('listajoburi.destroy',$row['id'])}}">
                                @method('DESTROY')
                                <input type="hidden" name="_token" value="@csrf">
                            </form>

and this is the route

Route::post('/listajoburi/{id}/', 'Auth\[email protected]')->name('listajoburi.destroy');

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.