hello @ahmedelgohary
Please share your model and migration
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
i would like to return all reservations that were done by all employees that existing in specific branch ((daily)) so there are 3 tables : ticket_reservations , employees , branches employees 1 to mini ticket_reservations branchs 1 to mini emloyees
public function RetreiveMoneyDaily(){
$TicketReservations = DB::table('ticket_reservations')
->select('ticket_reservations.created_at', DB::raw('SUM(price) as SumForToday'))
->join('employees', 'ticket_reservations.employee_id' , '=' , 'employees.id' )
->join('branches', 'employees.branch_id', '=', 'branches.id')
->groupBy('ticket_reservations.created_at')
->get();
return $TicketReservations;
}
i would like to get branches.id , ticket_reservations.price , employee.name
Thanks in Advance .
Please or to participate in this conversation.