This is my code of laravel routes file and all other routs working nicely but 'update' route giving an error that 'Route [dashboard.update] not defined' here is code of routes
Route::group(['middleware' => 'auth', 'prefix' => 'dashboard'],function (){
// get routes
Route::get('/', 'HomeController@index')->name('dashboard.index');
Route::get('add', 'HomeController@addNotice')->name('dashboard.add');
Route::get('{id}/edit', 'HomeController@editNotice')->name('dashboard.edit');
Route::get('{id}', 'HomeController@showNotice')->name('dashboard.show');
// post routes
Route::post('add', 'HomeController@storeNotice')->name('dashboard.store');
Route::post('{id}','HomeController@updateNotice')->name('dashboard.update'); //error here
Route::post('{id}', 'HomeController@deleteNotice ')->name('dashboard.delete');
});
here is the code of view return by HomeController
<form action="{{ route('dashboard.update',['noticeId' => $noticeId->id]) }}" method="POST" style="padding-left: 10px; padding-right: 10px;">
{{ csrf_field() }}
<div class="row">
<div class="form-group">
<input type="text" class="form-control" name="noticeTitle" placeholder="Give Title to Notice" value="{{ $noticeId->title }}">
</div>
</div>
<div class="row">
<div class="form-group">
<textarea name="noticeBody" cols="30" rows="8" class="form-control" placeholder="Add Notice Details Here" style="resize: none">{{ $noticeId->body }}</textarea>
</div>
</div>
<div class="row">
<div class="form-group">
<input type="submit" name="editNotice" value="Save Changes" class="btn btn-info btn-block btn-sm">
<input type="hidden" name="_method" value="PUT">
</div>
</div>
</form>