📜  laravel 随机排序 - PHP 代码示例

📅  最后修改于: 2022-03-11 14:54:37.600000             🧑  作者: Mango

代码示例2
Model::select('column')->where('column','value')->inRandomOrder()
    ->limit(2) // here is yours limit
    ->get();

------------------ OR --------------------

Model::inRandomOrder()->select('column')->where('column','value')->first();