So when you define a resource controller in a wildcard subdomain group route similar to this:
Route::group(array('domain' => '{subdomain}.example.com'), function() {
Route::resource('users', 'UserController');
});
on RouteServiceProvider
$router->model('user', 'App\User');
and on the UserController show method:
public function show($user)
{
return $user;
}
what i get is the subdomain name instead of the user resource. This is because the subdomain parameter is passed to controller methods and i would have to change them like this:
public function show($subdomain, $user)
{
return $user;
}
I simply don't want to add the subdomain parameter to each and every controller method in my app because i am not going to do anything with it. I use the subdomain parameter in a middleware to do some configuration changes.
How can i do it so the subdomain doesn't get passed to controllers as parameter?