This Error Happened when I tried to register a new user using RegistersUsers trait in :
this method must return an instance of the created (registered) user from the mentioned method , which is by default return this instance as follow :
look to the word return in the beginning .
if you manipulated the original code in this method and forgot to return an instance of the created user then Laravel will through this error..
App\Auth\RegisterController
Method : create
this method must return an instance of the created (registered) user from the mentioned method , which is by default return this instance as follow :
return User::create([ 'name' => $data['name'], 'email' => $data['email'], 'password' => bcrypt($data['password']), ]);
look to the word return in the beginning .
if you manipulated the original code in this method and forgot to return an instance of the created user then Laravel will through this error..
No comments:
Post a Comment