您好,我尝试使用 Laravel 创建面板管理员,但出现错误管理控制器.php1 <?php23 namespace App\Http\Controllers;45 use Illuminate\Http\Request;6 use Auth;7 class AdminController extends Controller8 {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 行的错误是它的书写
1 回答
冉冉说
TA贡献1877条经验 获得超1个赞
您->的代码中有错字错误更改此
if(Auth::attempt(['email'->$data['email'],'password'=>$data['password'],'admin'=>'1']))
{
}
到
if(Auth::attempt(['email'=> $data['email'],'password'=>$data['password'],'admin'=>'1']))
{
}
- 1 回答
- 0 关注
- 89 浏览
添加回答
举报
0/150
提交
取消