DEV Community

Customize Laravel Auth (Laravel Breeze Registration and Login)

Kingsconsult on December 10, 2020

Hello Artisans, after making a post on Basic Laravel Login and Registration using Laravel Breeze, I got a lot of private messages on how to customi...
Collapse
 
bicho44 profile image
Federico Reinoso

I know, maybe this is out of the scope of the tutorial, but, how you can add Roles to the register?
I just need to deny access to certain part of my site to certain role, (come can edit and some can only see)
It is possible?, or is better to go directly to Jetstream?
Thanks in advance.

Collapse
 
dreamhigh915 profile image
DreamHigh

Hi. king.
Now, I'm trying to use jQuery ajax method to send requests to the controller.
But, I've faced such an error.

Target [Laravel\Fortify\Contracts\RegisterViewResponse] is not instantiable.

Hope your kind help.

Collapse
 
kingsconsult profile image
Kingsconsult

Sorry, seeing this late, would be easier for me to debug if I see the way you are sending the request to the controller

Collapse
 
dreamhigh915 profile image
DreamHigh

Thank you. King.
I've solved it myself. :D
Thanks for your kindness reply again.

Collapse
 
marcelobianco profile image
Marcelo Bianco

Hi my friend
I have the following error: ErrorException
Undefined index:
my password field is called senha and it doesn’t pass this validation at all

public function validateCredentials(UserContract $user, array $credentials)

{

    $plain = $credentials['password'];



    return $this->hasher->check($plain, $user->getAuthPassword());

}
Enter fullscreen mode Exit fullscreen mode
Collapse
 
rahulmanek profile image
rahulmanek

I am also facing same issue
Any solution??

Collapse
 
fahrudinyw profile image
Fahrudin Yuniwinanto

why suddenly there is login_history? tought in part 1 and 2 there is no tell about login_history, make me little bit confuse. please tell me clearly. thanks

Collapse
 
adefowowe profile image
Adefowowe Adebamowo • Edited

Hi Kingsley, really nice series! Taking the customisation further, how might one implement login with either email or mobile phone (in one field) and password. Thanks.

Collapse
 
njoura7 profile image
Njoura7

thank you for this article mate!

what do you mean by login_history please ?

Collapse
 
wanazhad24 profile image
wanazhad24

Hey wanna ask, in a situation where I'm not using a Users table for the login, where am I supposed to change the referenced table?

Collapse
 
thatal profile image
Sunil Thatal

you can change it on config/auth.php providers configuration.

Collapse
 
wanazhad24 profile image
wanazhad24 • Edited

Is this correct? Even after I changed that, it is saying that the credentials is invalid.

'providers' => [
'staffs' => [
'driver' => 'eloquent',
'model' => App\Models\Staff::class,
'table' => 'staffs'
],

Thread Thread
 
thatal profile image
Sunil Thatal • Edited

yes it is correct. you don't have to add table if you are using eloquent. Add query listener above your code to monitor query.
\DB::listen(function($query){
\Log::debug($query->sql);
\Log::debug($query->bindings);
});

Collapse
 
arinzehills profile image
ARINZE CHRIS HILLS

please mine does'nt have does controllers, please can you help me out

Collapse
 
kingsconsult profile image
Kingsconsult

Hope you run these commands

composer require laravel/breeze --dev
php artisan breeze:install