mercredi 11 septembre 2019

laravel seprate logincontroller for admin users Base table or view not found

i created a seprate LoginController for admin, namespace is App\Http\Controllers\Admin\Auth;. when i attempt to login i get this error:

Base table or view not found: 1146 Table 'hotel.admins' doesn't exist (SQL: select count(*) as aggregate from `admins` where `email` = admin@admin.com)

this is login method:

 public function login(Request $request)
    {
        $this->validator($request);

        if (Auth::attempt($request->only('email', 'password'), $request->filled('remember'))) {
            //Authentication passed...
            return redirect()
                ->intended(route('admin.index'))
                ->with('status', 'ok');
        }
        //Authentication failed...
        return $this->loginFailed();

    }

users and admins are in same table. (Users table) how can i change it to check in user's table instead admin's table ?



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2N9y0uV
via IFTTT

Aucun commentaire:

Enregistrer un commentaire