working with Laravel 5.6 and I am going to delete table record from uploads images table. this is controller
public function deleteOneImage($id)
{
Upload::where('id', $id)->delete();
return redirect()->back()->with('info', 'Image deleted successfully');
}
and delete link in edit.blade.php
<a class="button is-outlined" href="/myads/{{$upload->id}}/delete" onclick="return confirm('Are you sure to want to delete this record?')" >Delete</a></td>
and route
Route::get('myads/{uploads}/delete', [
'uses' => '\App\Http\Controllers\VehicleController@deleteOneImage',
]);
but when I clicked delete buttons it does not delete the table records? how can I fix this problem?