Support the ongoing development of Laravel.io →
posted 9 years ago
Requests
Last updated 2 years ago.
0

Aparently, when defining a new route group I have to re-define the prefix. If I don't the prefix is no longer set.

So the problem is fixed by doing this:

/**
 *  Admin routes
 */
$app->group(['prefix' => 'admin', 'namespace' => 'App\Http\Controllers\WebsiteAdminControllers'], function($app){

	// The login page
	$app->get('login', ['as' => 'websiteAdminLogin', 'uses' => 'LoginController@getLoginForm']);


	// Private pages for logged in users
	$app->group(['prefix' => 'admin', 'middleware' => 'isWebsiteAdmin'], function($app){

		// Get the admin dashboard
		$app->get('/', 'DashboardController@getIndex');

	});

});
0

Sign in to participate in this thread!

Eventy

Your banner here too?

jerodev jerodev Joined 20 May 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.