I create 2 route (web.php
and admin.php
) in Laravel 5.6.
RouteServiceProvider.php
:
public function map()
{
$this->mapApiRoutes();
$this->mapWebRoutes();
$this->mapAdminRoutes();
}
protected function mapWebRoutes()
{
Route::middleware('web')
->namespace($this->namespace)
->group(base_path('routes/web.php'));
}
protected function mapAdminRoutes()
{
Route::middleware(['web', 'adminInformation'])
->prefix('manage')
->namespace($this->namespace)
->group(base_path('routes/admin.php'));
}
Now i need get just controller names in admin.php
.
For example:
$r = \Route::getRoutes();
foreach ($r as $value) {
echo($value->getName() . "<br />");
}
Method Route::getRoutes()
show all routes (web.php & admin.php).
How to get name controller just from admin.php
?
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire