Controller MessagesController:
public function destroy(Messages $message) { $message->delete(); return redirect()->route('messages.index')->with('message', 'Запись удалена.'); } routes.php:
Route::resource('messages', 'MessagesController@index'); Route::post('messages.store', ['as' => 'messages.store', 'uses' => 'MessagesController@store']); Route::delete('messages.destroy', ['as' => 'messages.destroy', 'uses' => 'MessagesController@destroy']); View page:
{!! Form::open(array('route'=>['messages.destroy',$message->id],'method'=>'DELETE')) !!} {!! Form::button('Удалить',['class'=>'btn btn-danger','type'=>'submit']) !!} {!! Form::close() !!} When you click on the button, a message about deletion is displayed, but this does not happen. It is still displayed on the view page.
Messages, you must pass at least$id- vp_arth intodelete