Want to access all of our courses? (36 h 00 min)
You also get:
Already a member? Login here
Cool I didn't know about:
User::where{ColumnTitle}($value)->first();
hello,I have a question about executing more than one query without it being affected
$users = User::query(); $users1 = $users->where('id', 1)->get(); // true $users2 = $users->where('id', 2)->get(); // empty ``` My way ```php $users = User::query(); $query = clone $users; $users1 = $users->where('id', 1)->get(); // true $users2 = $query->where('id', 2)->get(); // true ``` Is this the best way?
Interesting, I don't remember trying it in this way, cloning $users is totally fine by me. But I'm not sure I would even combine these, I would probably execute it in totally different two queries, for readability.
Did where day finds the day in the current month?
No, in any month.
Tell us what you like or what we can improve
Feel free to share anything you like or dislike about this page or the platform in general.
Your feedback has been received. We truly appreciate you taking the time to help us improve.
Cool I didn't know about:
hello,I have a question about executing more than one query without it being affected
Interesting, I don't remember trying it in this way, cloning $users is totally fine by me. But I'm not sure I would even combine these, I would probably execute it in totally different two queries, for readability.
Did where day finds the day in the current month?
No, in any month.