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

Popular posts from this blog

jquery - How do you format the date used in the popover widget title of FullCalendar? -

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -