jeudi 2 mars 2017

Laravel Wildcard Subdomain for User

I am looking to implement a whitelabel solution to my platform and need to implement wildcard subdomains for or system, the only issue is our system sits on a subdomain its self. So I need to filter out anything that comes to a specific subdomain.

// *.website.co.uk
Route::group(['domain' => '{element}.website.co.uk'], function() {
    Route::get('/', function ($element) {
        dd($element);
    });
});

// my.website.co.uk
Route::get('/', 'PagesController@getLogin');
Route::post('/', 'PagesController@postLogin');

However using the code above I get the error:

Undefined variable: element

How would I avoid this error?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire