php - Laravel - No query results for model -
i gettin error 'no query results model [app\user].', when trying find user query.
if(user::where('email', '=', request::only('email'))->firstorfail()){ $validator->errors()->add(...); }
request::only()
return array. in case: ['email' => 'the-value-of-email']
. either this:
user::where(request::only('email'))->firstorfail()
or use request::input()
retrieve value:
user::where('email', '=', request::input('email'))->firstorfail()
Comments
Post a Comment