Squire's avatar

Get specific columns using firstOrFail

Hello, is there a way to use first or fail and also get only some columns?

I have a table which have a lot of columns, so, excluding all of those tables is likely not an option. I was using this: return $this->where([$filter => $identifier, 'Password' => $password])->get(['project_id', 'first_name']);

and it works fine, but I want it to throw the not found exception if doesn't find anything in the db

0 likes
1 reply

Please or to participate in this conversation.