I
I
ilya173922019-08-23 14:07:03
Laravel
ilya17392, 2019-08-23 14:07:03

How to make the registration form in Laravel be an authorization form at the same time?

That is, it should check if the user is registered, if not, then immediately register and log in, and if there is one, then check the password and log in? How to implement please tell me

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim, 2019-08-23
@Qumbeez

In the method that you call on the route, you check the presence of a user, if there is, then using Auth::attempt() you try to authorize, etc., if there is no such user, then User::create() and then Auth::attempt( )

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question