Route::get('/user/login', 'UserController@login');
或者
Route::get('/login', 'UserController@login');
都会报错:
InvalidArgumentException
Route [login] not defined.
LoginController.php
namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\AuthenticatesUsers;
class LoginController extends Controller
{
use AuthenticatesUsers;
protected $redirectTo = '/';
public function __construct()
{
$this->middleware('guest')->except('logout');
}
}