0

I am working in Laravel 5.1, the login used to work fine but I changed the default Users Table to admin_users and problem started. The Route::post('auth/login','Auth\Authcontroller@getLogin'); works fine but When I try to login, it redirects to the same page. Below is the part of Routes.php page. I want the login to lead to index page from DashboardController.

Route::get('auth/login', 'Auth\AuthController@getLogin');
Route::post('auth/login', 'Auth\AuthController@postLogin');
Route::get('auth/logout', 'Auth\AuthController@getLogout');

Route::group(['prefix' => 'admin', 'middleware' => 'auth', 'as' => 'admin.', 
'namespace' => 'Admin'], function() {
    Route::get('/', 'DashboardController@index')->name('index');
});

What do you think is the problem? Can anyone suggest or help?

Deepa_Tmg
  • 1
  • 1
  • 5

1 Answers1

0

In your User model declare the custom table like so:

public $table = "admin_users";

And in your config folder, open auth.php and make sure under providers > users the driver is eloquent and the correct model path that corresponds to your User model is specified.

Galanx
  • 129
  • 1
  • 10
  • Everything is fine there. User model has the statement `protected $table = "admin_users";` The auth.php file is also fine. – Deepa_Tmg Feb 27 '18 at 09:11