管理面板数组到字符串的转换

您好,我尝试使用 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 行的错误是它的书写


Helenr
浏览 90回答 1
1回答

冉冉说

您->的代码中有错字错误更改此if(Auth::attempt(['email'->$data['email'],'password'=>$data['password'],'admin'=>'1']))&nbsp;{}到if(Auth::attempt(['email'=> $data['email'],'password'=>$data['password'],'admin'=>'1']))&nbsp;{}
打开App,查看更多内容
随时随地看视频慕课网APP