It’s Official: The 2019 Standard Deduction Is Getting Even Large
LaravelPHP

How to rename users DB table in default Laravel Auth

Replace users with your required table in following files

1. Migration file

2. Change the table in app/User.php

3. Change the table in config/auth.php

‘providers’ => [ ‘users’ => [ ‘driver’ => ‘eloquent’, ‘model’ => App\User::class, ],],

4. Validation rule – unique email check

In default app/Http/Controllers/Auth/AuthController.php there are validation rules listed. One of them states that email has to be unique – so we need to change the table it is checking: protected function validator(array $data) { return Validator::make($data,[ ‘name’ => ‘required|max:255′, ’email’ => ‘required|email|max:255|unique:users’, ‘password’ => ‘required|confirmed|min:6’, ]); } Change the part ‘unique:users’ to ‘unique:admins’.

About author

Love coding, crazy about logic, like solution architecting and solving problems. Thirsty for knowledge, challenges & most importantly innovation. One of the passionate brain behind SpryOX
Related posts
APIGoogleGoogle URL ShortenerPHPYoutube

Steps to generate YouTube Data API and URL Shortener API

JavaScriptJqueryPHP

Escape javascript special characters compilation error using encodeURIComponent()

APIPHPSMS Gatewayssmshorizon

Simple sms integration of smshorizon api

PHPPHP Mailer

PHP Mailer failing with Warning: preg_match(): Compilation failed

Sign up for our Newsletter and
stay informed

Leave a Reply

Your email address will not be published. Required fields are marked *