Try this:
Route::get('edit-workout-category/{id}', ['as' => 'edit-workout-category', 'uses' => 'WorkoutCategoryController@edit']);
pogachar said:
Try this:
Route::get('edit-workout-category/{id}', ['as' => 'edit-workout-category', 'uses' => 'WorkoutCategoryController@edit']);
No :( same error.
Remove the "/" from form model. If you want to use routes you have to name them with 'as' => 'something'. Yours is named /edit-workout-category. Sorry I haven't spotted that one before.
Now you need to change also Form::model() - removing the / as user pogachar
said
{{ Form::model($WorkoutCategory, array('route' => array('edit-workout-category', $WorkoutCategory->id), 'id' => 'add_workout_category_form', 'class' => 'form-horizontal', 'role'=>'form')) }}
or common conception in naming the routes is
Route::get('edit-workout-category/{id}', ['as' => 'category.workout.edit, 'uses' => 'WorkoutCategoryController@edit']);
and the Form::model would be
{{ Form::model($WorkoutCategory, ['route' => ['category.wrokout.edit', $WorkoutCategory->id], 'id' => 'add_workout_category_form', 'class' => 'form-horizontal', 'role'=>'form']) }}
Thanks guys it is working:
{{ Form::model($WorkoutCategory, array('route' => array('edit-workout-category', $WorkoutCategory->id), 'id' => 'add_workout_category_form', 'class' => 'form-horizontal', 'role'=>'form')) }}
Route::get('edit-workout-category/{id}', ['as' => 'edit-workout-category', 'uses' => 'WorkoutCategoryController@edit']);
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community