Xampp 如何使用Laravel 5.3子域路由?

Xampp 如何使用Laravel 5.3子域路由?,xampp,subdomain,laravel-5.3,Xampp,Subdomain,Laravel 5.3,我有一个可以通过localhost/example访问的网页,其中有一个带有公司注册区的主页。提交该表单后,页面应重定向到localhost/register。示例,但我收到了一个错误 URL: register.example (the localhost is missing?) *This site can’t be reached. register.example's server DNS address could not be found.* web.php路由文件 Route:

我有一个可以通过localhost/example访问的网页,其中有一个带有公司注册区的主页。提交该表单后,页面应重定向到localhost/register。示例,但我收到了一个错误

URL: register.example (the localhost is missing?)
*This site can’t be reached. register.example's server DNS address could not be found.*
web.php路由文件

Route::get('/', 'HomepageController@homepage');

Route::group( ['domain' => 'register.example'], function () {
    Route::get('/', [
        'uses' => 'AccountController@register',
        'as' => 'companyregister'
    ]);
});
我还将我的config/session.php行更改为

'domain' => env('SESSION_DOMAIN', 'example'),

我已经到处找了,但是Laracasts关于这个的课程不是免费的。我使用的是XAMPP。

如果您的主页位于localhost/example,这意味着
/example
目录是保存所有laravel文件的地方。
当您使用xamp之类的工具时,创建子域是另一种游戏(有时可能非常棘手)

为了给您一个说明,假设您已经有一个域:
它的子域将是

因此,在您自己的情况下(xamp),您的域是
其子域将为
(遗憾的是,我不知道如何在当地环境中设置它)

您试图做的是将post数据从主域发送到其子域,我认为应该通过api调用来处理

因此,我建议您在使用子域之前尝试使用简单路由。尝试将主页重定向到
http://localhost/example/register

Route::get('/', 'HomepageController@homepage');
Route::get('/register', [
    'uses' => 'AccountController@register',
    'as' => 'companyregister'
]);

我觉得你有.net的背景。我似乎不明白你用
['domain'=>'register.ezloans']
@OniyaDaniel ezloans应该是示例域,抱歉。我刚才改了。@OniyaDaniel我在看这些文件,我也决定用那个文件来开始。谢谢你抽出时间!:)