There is a route:
Route::get('message/{id}/edit', ['uses' => 'HomeController@edit', 'as' => 'message.edit'])->where(['id' => '[0-9]+']);
Code in my HomeController:
public function edit($id) {
$data = [
'title' => 'page',
'pagetitle' => 'page',
'message' => Message::find($id)
];
return view('pages.messages.edit', $data);
}
And a view:
@extends('index')
@section('content')
{!! Form::open(['route' => 'message.edit']) !!}
@include('_common._form')
{!! Form::close() !!}
@stop
And I get this error:
ErrorException in UrlGenerationException.php line 17:
Missing required parameters for [Route: message.edit] [URI: message/{id}/edit]. (View: C:\OpenServer\domains\laravel\bookesources\views\pages\messages\edit.blade.php)
Where is the problem? I tried to remove form from code, it works well. So it means that something wrong with the form.
You need to pass an ID, because your route demands it.
It should be like the following:
{!! Form::open(['route' => ['message.edit', $message]]) !!}