return $this->belongsToMany(Dishe::class, 'dishes', 'menu_id', 'menu_id', 'category_id', 'id');
Users::where('created_at', '>', Carbon::now()->subHours(24))
->select('login')->groupBy('login')->orderBy(DB::raw('count(*) desc'))->get();
<br>
UPDATE fine SET sum_fine = sum_fine * 2 <br>
From (SELECT name, number_plate, violation<br>
FROM fine<br>
GROUP BY name, number_plate, violation<br>
HAVING count(*) > 1<br>
) query_in<br>
WHERE fine.name = query_in.name AND fine.number_plate = query_in.number_plate AND fine.violation = query_in.violation AND fine.date_payment IS NULL;