My code
$datas = DB::table('patrol_gate_surveillance_transactions as a')
->leftJoin('client_locations as b','a.client_location_id', 'b.id')
->leftJoin('clients as c', 'b.client_id', 'c.id')
->select('a.client_location_id as location_id', 'b.name as location_name', 'c.name as client_name',
DB::raw('SUM(CASE WHEN a.type = 1 THEN employee_qty ELSE 0 END) as e_qty_in'),
DB::raw('SUM(CASE WHEN a.type = 2 THEN employee_qty ELSE 0 END) as e_qty_out')
)
->groupBy('location_id', 'location_name', 'client_name')
->get();
I want to get the last created_at and updated_at only
My table
dd()
i need created_at and updated_at only for parsing data to blade

