A
A
antonio02262018-03-31 15:07:03
Laravel
antonio0226, 2018-03-31 15:07:03

How to test work on different laravel domains?

Welcome all. There is one Laravel project.
There are routes like

<?

switch ($_SERVER['HTTP_HOST']) {
    case 'lol.ru':
        #сюда идет дизайн стандартный, который есть в проектк

        Route::get('/', '[email protected]');

        Auth::routes();

        Route::post('/sendRequestButton', '[email protected]')->name('sendRequestButton');
        Route::post('/sendRequestFeedback', '[email protected]')->name('sendRequestFeedback');

        Route::group(['prefix' => 'home'], function (){
            Route::get('/', '[email protected]')->name('home');
            Route::post('/showProposalsMonth', '[email protected]')->name('showProposalsMonth');
            Route::post('/showProposalsWeek', '[email protected]')->name('showProposalsWeek');
            Route::post('/showProposalsDay', '[email protected]')->name('showProposalsDay');
        });

        break;
    case 'kek.ru':
        # сюда идет дизайн который я делал
        // роуты сюда
        break;
    case '':
        #тут будет еще один , но пока нет дизайна

        break;
    default:
        return false;
        break;
}

I understand how to organize it, but I don’t understand how to test and separate one DB for 1 template, another DB for 2 templates. Before that, I worked with MAMP and launched laravel via php artisan serv, but now I need to make 2 domains, the 1st launches the 1st template, the 2nd launches the 2nd template. How to do it ? I use MacOS

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Pushkarev, 2018-03-31
@antonio0226

In the lara out of the box there is a group for domains - Route::domain. You make such a crutch...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question