Error after registering and redirecting
PS: it does the registration normally, and I can access normally, but this error always!
I MAKE A MODIFICATION ONLY IN THE USER REGISTRATION, MAKE THE PARAMETERIZATION OF MY MANY TO MANY RELATIONSHIP WHICH 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 SECTION OF THE CODE $ this-> gt; () - > login ($ user); ** ** I BELIEVE that - > attach ($ request-> company_id) is giving the user a different return than the $ this- > login ($ user); accurate