📜  laravel 和 xampp 中的子域 - PHP 代码示例

📅  最后修改于: 2022-03-11 14:53:36.880000             🧑  作者: Mango

代码示例1
Update Locally : \xampp\apache\conf\extra\httpd-vhosts.conf


    DocumentRoot "E:/xampp/htdocs/project_name/public"
    ServerName localhost
    ServerAlias *.localhost
    
        Order allow,deny
        Allow from all
    

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