My goals are:
- Have 2 main domains .com and .dev for production and local installations
- Have 2 main subdomains. One for the site and one of the application
- Site must be public and application always to be secured.
My take on the above:
<?php
$approutes =function (){
Route::group(['middleware' => 'auth'], function(){
Route::get('/', 'AdminController@index');
Route::get('profile/{user}','ProfileController@index');
Route::post('profile/{user}/update',array('as' => 'profile.update','uses' => 'ProfileController@update'));
Route::resource('posts','PostsController');
Route::resource('tags','TagsController');
Route::resource('health','HealthController');
Route::resource('health-categories','HealthCategoriesController');
});
Route::controllers([
'auth' => 'Auth\AuthController',
'password' => 'Auth\PasswordController'
]);
};
$siteroutes =function (){
Route::get('/', 'SiteController@index');
};
Route::group(['domain' => 'my.xxxx.com'],$approutes);
Route::group(['domain' => 'my.xxxx.dev'],$approutes);
Route::group(['domain' => 'www.xxxx.com'],$siteroutes);
Route::group(['domain' => 'www.xxxx.dev'],$siteroutes);