您好,我尝试使用 Laravel 创建面板管理员,但出现错误
管理控制器.php
1 <?php
2
3 namespace App\Http\Controllers;
4
5 use Illuminate\Http\Request;
6 use Auth;
7 class AdminController extends Controller
8 {
9 public function login(Request $request)
10 {
11 if($request->isMethod('post')){
12 $data = $request->input();
13 if 14(Auth::attempt(['email'->$data['email'],'password'=>$data['password'],'admin'=>'1'])) {
echo "Success"; die;
}else{
echo "Failed"; die;
}
}
return view('admin.admin_login');
}
}
第 14 行的错误是它的书写
冉冉说