Php 如何在LARAVEL中隐藏URL变量
网络路线是Php 如何在LARAVEL中隐藏URL变量,php,laravel,Php,Laravel,网络路线是 Route::post('/loginext/{username}/{password}', 'LoginControllerExt@checkLogin'); 在调用url时 http://localhost/old/loginext/bank/test 它将调用控制器并获得响应。但那一次url是 http://localhost/old/loginext/bank/test 我想将url显示为 http://localhost/old/ LoginControlle
Route::post('/loginext/{username}/{password}', 'LoginControllerExt@checkLogin');
在调用url时
http://localhost/old/loginext/bank/test
它将调用控制器并获得响应。但那一次url是
http://localhost/old/loginext/bank/test
我想将url显示为
http://localhost/old/
LoginControllerText控制器
public function checkLogin(Request $request)
{
$LoginID=$request->username;
$Password=$request->password;
$Status='Success';
if($Status == 'Success' ) {
return view('dashboard.index');
}
}
将路线更改为
Route::post('/loginext', 'LoginControllerExt@checkLogin');
在请求正文中传递凭据。请与邮递员联系
内部控制器
public function checkLogin(Request $request)
{
dd($request->all());
}
在请求正文中传递值,而不是在URL中发送。您不能。除非您使用post请求并在正文中添加凭据。不要使您的路由
/loginext/{username}/{password}
,然后,使用请求发送凭据如何传入请求正文?您正在使用表单?当我尝试使用url回显变量时,它显示404错误