Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

subdomain in laravel and xampp



Update Locally : xamppapacheconfextrahttpd-vhosts.conf

<VirtualHost *:80>
    DocumentRoot "E:/xampp/htdocs/project_name/public"
    ServerName localhost
    ServerAlias *.localhost
    <Directory "E:/xampp/htdocs/project_name/public">
        Order allow,deny
        Allow from all
    </Directory>
</VirtualHost>
Then Try this routing

Route::group([
    'domain'    => '{office_name}.localhost'
],function(){
    Route::get('/', function () {
        return 'I AM OFFICE OWNER';
    });
});

Route::get('/', function () {
    return 'I AM SITE VISITOR';
});
Run with php artisan serv
 
PREVIOUS NEXT
Tagged: #subdomain #laravel #xampp
ADD COMMENT
Topic
Name
9+5 =