In my Controller
$items = Item::all();
I want to get the first 6 items only
How to change the code?
Use take()
method:
$items = Item::take(6)->get();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With