I want to get only 5 data from user table
I try to write User::where("","")->get(5);
but seems not working.
Advertisement
Answer
Use instead:
User::query()->take(5)->get();
Or if with where condition:
User::query()->where("column", "value")->take(5)->get();