I am trying to create a navigation menu, I have 3 such elements:
- Control Panel
- Pages
- Articles
Now I want to highlight in bold Pageswhen the user is in this section,
and if the page AddI want as a bold PagesandAdd
my routes.php:
Route::group(array('prefix' => 'admin', 'before' => 'auth.admin'), function()
{
Route::any('/', 'App\Controllers\Admin\PagesController@index');
Route::resource('articles', 'App\Controllers\Admin\ArticlesController');
Route::resource('pages', 'App\Controllers\Admin\PagesController');
});
I found the thid method:
$name = \Route::currentRouteName();
var_dump($name);
But this method returns string 'admin.pages.index' (length=17)
Should I use spliteto get the controller or does Laravel have a method for this?
source
share