I am grouping a controller profileand I want to reference it. Then I define this route:
Route::group(array('prefix'=> 'admin', 'before' => 'csrf'), function(){
Route::resource('/profile' , 'ProfileController', array('as'=>'profile') );
});
and this is my menu link:
<li><a href="{{ URL::route('admin.profile') }}">profile Managment</a></li>
and this is my result routein the terminal:
+--------+----------------------------------+------------------------+---------------------------+----------------+---------------+
| Domain | URI | Name | Action | Before Filters | After Filters |
+--------+----------------------------------+------------------------+---------------------------+----------------+---------------+
| | GET / | index | Closure | | |
| | GET admin/index | dashboard | Closure | | |
| | GET logout | logout | Closure | | |
| | POST auth | auth | Closure | csrf | |
| | GET login | login | Closure | | |
| | GET admin/profile | admin..profile.index | ProfileController@index | csrf | |
| | GET admin/profile/create | admin..profile.create | ProfileController@create | csrf | |
| | POST admin/profile | admin..profile.store | ProfileController@store | csrf | |
| | GET admin/profile/{profile} | admin..profile.show | ProfileController@show | csrf | |
| | GET admin/profile/{profile}/edit | admin..profile.edit | ProfileController@edit | csrf | |
| | PUT admin/profile/{profile} | admin..profile.update | ProfileController@update | csrf | |
| | PATCH admin/profile/{profile} | | ProfileController@update | csrf | |
| | DELETE admin/profile/{profile} | admin..profile.destroy | ProfileController@destroy | csrf | |
+--------+----------------------------------+------------------------+---------------------------+----------------+---------------+
Now I get this error:
ErrorException
Route [admin.profile] not defined. (View: /var/www/alachiq/app/views/back_end/menu.blade.php) (View: /var/www/alachiq/app/views/back_end/menu.blade.php) (View: /var/www/alachiq/app/views/back_end/menu.blade.php)
source
share