0
Error after registering and redirecting
PS: he makes the registration normally, and I can access normally, but always give this error!
I made a modification only in the user register, I parameterized my relationship many to many that also works
public function register(Request $request)
{
$this->validator($request->all())->validate();
event(new Registered(
$user = $this->create($request->all())->companies()->attach($request->company_id)
));
$this->guard()->login($user);
return $this->registered($request, $user)
?: redirect($this->redirectPath());
}
THE ERROR IS IN THIS CODE SNIPPET $this->Guard()->login($user); ** **I BELIEVE ->attach($request->company_id) is making the user give a different return than $this->Guard()->login($user); needs
I can’t work this way you passed me because I’m in the role 'Event(new Registered( $user = $this->create($request->all())->roles()->attach(12) ); ' @rfl
– Gabriel Alves
@Gabrielalves speaks the
register
user outside theevent
and pass only the return to the classRegistered
.– RFL