L
L
LP-DIMAN2015-11-04 09:14:17
PHP
LP-DIMAN, 2015-11-04 09:14:17

How can I prevent the user from logging in immediately after registering?

Here is the standard function: $this->auth->login($this->registrar->create($request->all()));
As I understand it, she registers a new user and immediately logs in. I only need registration so far
Tried $this->registrar->create($request->all());
But error: Trying to get property of non-object.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Ernest Faizullin, 2015-11-04
@LP-DIMAN

Try to define the $this->auth and $this->registrar objects beforehand in the constructor

public function __construct(Guard $auth, Registrar $registrar)
{
  $this->auth = $auth;
  $this->registrar = $registrar;
}

After that $this->registrar->create($request->all());should work separately
UPD: not that) just User::create($request->all()) instead of registrar

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question