我试图重定向登录到另一个页面。Laravel登录重定向
即使在登录控制器中显示'/ welcome',它现在也会重定向到'/'。 (使用laravel的默认认证)。
它看起来像完全忽略了登录控制器。
LoginController.php
<?php
namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\AuthenticatesUsers;
class LoginController extends Controller
{
/*
|--------------------------------------------------------------------------
| Login Controller
|--------------------------------------------------------------------------
|
| This controller handles authenticating users for the application and
| redirecting them to your home screen. The controller uses a trait
| to conveniently provide its functionality to your applications.
|
*/
use AuthenticatesUsers;
/**
* Where to redirect users after login.
*
* @var string
*/
protected $redirectTo = '/welcome';
/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
$this->middleware('guest', ['except' => 'logout']);
}
}
,因为它似乎像它完全无视登录控制器,我对如何甚至可以登录困惑。
你的意思是它重定向到'/'** **后登录成功? – Paras
是的,多数民众赞成在我的意思是,它很奇怪,因为它说重定向/欢迎 –