Take the 2-minute tour ×
Code Review Stack Exchange is a question and answer site for peer programmer code reviews. It's 100% free, no registration required.

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);
share|improve this question

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.