That table got an 'id' column right?
Just use:
Restaurant::where('id', $v['id'])->delete();
I'm curious by the way, why would you delete records while you fetch it and return it to view?
Are you sure your code is running fine, as i haven't see where $restaurants variable is setting,
anyways you must got the model object inside this loop , you can simply do
$data->delete();
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community