呼叫admincontroller不存在

时间:2018-07-11 10:24:27

标签: class

这是我用于管理员登录的控制器:

namespace App\Http\Controllers\Auth;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use Auth;

class AdminLoginController extends Controller
{
    public function __construct(){
        $this->middleware('guest:admin');
    }
    public function showLoginForm(){
        return view('auth.admin-login');
    }
    public function login(Request $request){
        //validate the form data
        $this->validate($request, [
           'email' => 'required|email',
           'password'=> 'required|min6'
        ]);
        //attemo to log the user in
        if (Auth::guard('admin')->attempt(['email'=> $request->email, 'password'=>$request->password], $request->rmember)){
              //if successful, then redirect back to their intended location
              return redirect()->intended(route('admin.dashboard'));
        }
        //if unsuccessful, then redirect back to login with the form data
        return redirect()->back()->withInput($request->only('email','remember'));
    }
}

但我收到此错误: 类App \ Http \ Controllers \ AdminLoginController不存在

0 个答案:

没有答案