路由
Route::group(['domain' => 'laravel.8g.com','namespace' => 'Admin'],function() { Route::get('/admin/login','LoginController@login'); Route::post('/admin/signin','LoginController@signin');});
控制器(Http\Controllers\Admin\LoginController.php)
all()); $username = $request->input("username"); $password = $request->input('password'); var_dump($username); var_dump($password); return view("login/signin"); }}
模板(reeources\views\login\login.blade.php)
test
{ { csrf_field() }} //这个是直接输出一个input标签
登录验证
use Illuminate\Support\Facades\Auth;$res = Auth::attempt(['name' => $username, 'password' => $password]);或$res = Auth::attempt(['email' => $email, 'password' => $password]);