Reputation: 612
what did i do is creating this vies for delete function according to its trainee_id.see the screenshot.
Controller segment is like this
public function admin_destroy($trainee_id)
{
UserFeedbackController::where('trainee_id','=',$trainee_id)->delete();
return back();
}
Route like this
Route::get('DeleteCertificates/{trainee_id?}', 'UserFeedbackController@admin_destroy')->where('trainee_id', '(.*)');;
linked button in the view as following this
<td>
<a class="btn btn-danger" href="DeleteCertificates/{{ $item->trainee_id }}">Delete</a>
</td>
can anyone suggest me why this getting error.
Upvotes: 0
Views: 1964
Reputation: 27523
you are calling the controller name in place of model name, guess the modelname is
UserFeedback
so use this
UserFeedback::where('trainee_id','=',$trainee_id)->delete();
Upvotes: 2