jeudi 25 août 2016

How to use RouteCollection in Laravel5.0

I want to all route namelist, actionlist and other data inside of controller in laravel 5.0 by using

I've used below code in view it will word as well but if I used in Controller I will get errors

    $routes = Route::getRoutes();
    dd($routes);

Errors happen when I used this method in Controller.

FatalErrorException in Handler.php line 26:
Uncaught TypeError: Argument 1 passed to App\Exceptions\Handler::report() must be an instance of Exception, instance of Error given, 
called in vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php on line 73 and defined in 
.../app/Exceptions/Handler.php:26
Stack trace:
#0 /vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(73): App\Exceptions\Handler->report(Object(Error))
#1 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->handleException(Object(Error))
#2 {main}
thrown

This is the result if i used those methods inside of views

  #routes: array:3 [▶]
  #allRoutes: array:329 [▶]
  #nameList: array:260 [▶]
  #actionList: array:325 [▶]



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire