/** * Display a listing of the resource. * * @return string Data shift dan request. */ public function index() { // if (Auth::check()) { $id_karyawan = Auth::user()->id_karyawan; $today = date("Y-m-d"); $getNotice = Notice::byDivisi(Auth::user()->id_divisi); $shift = \DB::table('shift')->get(); $month_end = date('Y-m-d', strtotime('last day of this month', time())); $shiftLine = Shift::join("shift", "shift_line.id_shift", "=", "shift.id_shift")->where("id_karyawan", "=", $id_karyawan)->whereBetween("tanggal_shift", array($today, $month_end))->orderBy("id_shiftline")->get(); $req = rModel::join("shift_line", "request.shift_lama", "=", "shift_line.tanggal_shift")->where("request.id_karyawan", "=", "{$id_karyawan}")->orderBy("id", "DESC")->first(); return view('shift/index')->with("getNotice", $getNotice)->with("shift", $shift)->with("shiftLine", $shiftLine)->with("req", $req); } else { return \Redirect::to('login'); } }