PHP code example of bvharen / laravel-subdomain

1. Go to this page and download the library: Download bvharen/laravel-subdomain library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

bvharen / laravel-subdomain example snippets

$xslt
Route::group(['domain' => '{app}.subdomains.app','middleware' => ['auth']],function (){
    Route::get('/','SubController@index')->name('index');
    Route::get('/{param}',SubController@param)->name('param')
    //Rest of routes
});
$xslt
Route::group(['domain' => '{app}.subdomains.app','middleware' => ['auth','subdomains']],function (){
    //Rest of routes
});