I have set a wildcard subdomain and the subdomain name dynamically represent an account. I want to use this account name to check if the user can see a particular resource. I also want to use this account name in several controllers to print custom data about the account.
Route::group(array('domain' => '{account}.mywebsite.com'), function()
{
Route::group(array('before' => 'check_account'), function() // I want to use $account in check_account filter
{
Route::resource('users', 'UserController');
Route::resource('docs', 'DocController'); // I want to use $account in this controller
});
});
How can I use the $account
variable in a filter and in a method of a resource controller ?