【发布时间】:2020-12-31 21:47:00
【问题描述】:
提前谢谢你,
我定义了一条路线
Route::get('/registration/verify/{token}', 'UserController@verifyRegisteredEmail')->name('registration.email.verification');
我正在访问类似的路线
route('registration.email.verification', ['token' => $email_register_verification_token]);
当我在上面打印时,它如下所示
http://localhost/registration/verify/87006dcc95bcf7a9ea83e523f2aa53f9
但应该是的
http://localhost/{root}/registration/verify/87006dcc95bcf7a9ea83e523f2aa53f9
【问题讨论】:
-
你试试
APP_URL=http:://.sitename -
APP_URL=http:://domain.com可以解决这个问题,您还有一个问题:Yes this worked, but when i am passing the same things in href of an anchor tag, it is not required to set APP_URL,因为在您的浏览器上,您的href将您当前的域设置为根 url。假设您当前的域是 2domain.com/hello/index.php,而您的href是/style.css,那么您的浏览器将调用domain.com/style.css。如果您的href是style.css,那么它将调用domain.com/hello/style.css -
Yupp 明白了你的意思,非常感谢@sta