lundi 30 novembre 2020

laravel get specific random model

I use laravel 8. get random 3 users:

Users::inRandomOrder()->limit(3)->get();

but I want to add a specific user to the random output.

example :

Users::find(1);

output:

// [1, 5, 7, 9]

Thanks for helps




Aucun commentaire:

Enregistrer un commentaire