Level 102
You need an array of key value pairs
But you can just use the db query to get a collection, which I assume is what you actually want
$collection = DB::table('attendance as in')
->where('in.in_out', 'in')
->where('in.attendance_location_id', $locations->id)
->where('in.company_id', '!=', \Session::get('selected_company'))
->whereDate('in.created', Carbon::today())
->leftJoin('attendance as out', function ($join) {
$join->on('in.employee_id', 'out.employee_id')
->where('out.in_out', 'out')
->where('out.attendance_location_id', 'in.attendance_location_id')
->whereDate('out.created', Carbon::today());
})
->join('employee', 'employee.id', 'in.employee_id')
->join('location_library', 'location_library.id', 'in.attendance_location_id')
->join('company as cp', 'cp.id', 'in.company_id')
->join('employee_in_app as e_app', 'e_app.employee_id', 'in.employee_id')
->select('employee.name', 'cp.alias', 'in.employee_id','location_library.location_name', DB::raw('DATE_FORMAT(in.attendance_time, "%H:%i:%s") as in_time'), DB::raw('DATE_FORMAT(out.attendance_time, "%H:%i:%s") as out_time'), 'e_app.note')
->orderBy('in.attendance_time', 'DESC')
->get();
dd($collection);