mercredi 26 avril 2017

Laravel default Auth::routes() inside of group prefix

I'm attempting to create a prefix with a variable for "companies" to login to the platform. All users are tied to a company so the normal /login isn't desired. I'd like to use something like `/acme-company-name/login

I am using the default Laravel auth via: php artisan make:auth on a fresh install.

Route::group(['prefix' => '{company}'], function () {
    Auth::routes();
});

When I try navigating to /company-name/login I see the following error:

Missing required parameters for [Route: login] [URI: {company}/login].

Looking inside the auto-generated login.blade.php I see the function call route('login') and this seems to be where everything is breaking. I think I need some way to supply a variable to that function or redefine what the "login" route is in some fashion ? I'd rather not have to replace the call Auth::routes() but will certainly do so if that is required to fix this issue.

I should note, i've tried defining the group 'as' => 'company' and changing route('company.login') but then I am told the route company.login is not defined.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire