mercredi 21 octobre 2015

Using named routes in a laravel 5.1 config file

I'm trying to use a named route in my config file and I keep getting a 500 error.

<?php
return [
    'Warden' => [
         route('warden::models', ['user']), 
         'fa fa-btn fa-fw fa-user-secret text-success'
    ],
    'Dispatch' => [
         route('dispatch::index'), 
         'fa fa-btn fa-fw fa-fa-microphone text-success'
    ],
    'Identicon' => [
         route('identicon::main', [md5(Auth::user()->email)]), 
         'fa fa-btn fa-fw fa-get-pocket text-success'
    ]
];

I was wondering if there might be something in Laravel that is preventing this from happening. If not, am I doing something improperly?

Also: Side note.

PHP Catchable fatal error:  
   Argument 2 passed to Illuminate\Routing\UrlGenerator::__construct()  must be an instance of Illuminate\Http\Request, null given, called in 
   /home/austin/html/hidden/vendor/laravel/framework/src/Illuminate/Routing/RoutingServiceProvider.php on line 62 
   and defined in /home/austin/html/hidden/vendor/laravel/framework/src/Illuminate/Routing/UrlGenerator.php on line 99

Is the only error I get in my console and that's only when I use php artisan serve.



via Chebli Mohamed

1 commentaire:

Unknown a dit…

it turns out you can't use anything except env, getenv in config files

Enregistrer un commentaire