0
votes

I want to create a login form for admin dashboard. I have already created the relevant Controllers and blades but when I try login in admin dashboard error of EloquentUserProvider. I only want a login form for admin side not for users.

Error:

FatalThrowableError in EloquentUserProvider.php line 114: Type error: Argument 1 passed to Illuminate\Auth\EloquentUserProvider::validateCredentials() must be an instance of Illuminate\Contracts\Auth\Authenticatable, instance of App\Admin given, called in C:\Ampps\www\jobapp\vendor\laravel\framework\src\Illuminate\Auth\SessionGuard.php on line 385

Routes:

Route::get('/admin/login', 'Auth\AdminLoginController@showLoginForm')->name('admin.login');
Route::post('/admin/login', 'Auth\AdminLoginController@login')->name('admin.login.submit');
Route::get('/', 'Admin\DashboardController@index')->name('admin.dashboard');
Route::get('/admin/logout', 'Auth\AdminLoginController@adminlogout')->name('admin.logout');
1
use a middle ware to block common users - User123456
where and how ?? - MA-2016
Write a middleware in App/Http/Middleware to check access, then call it in controller method or in construct - User123456
Read this laravel.com/docs/5.5/middleware, and edit the middleware according to your need. - Shubham Pokhriyal

1 Answers

0
votes

if you want login, register, reset password, dashboard

cd your current directory

then type below command you will get login, register, reset password, dashboard

**php artisan make:auth**