Ejemplo n.º 1
0
 public function getMyLeaveCard($id)
 {
     $months = MonthRef::all();
     //========Query to get the Balance of the User monthly
     $vac = MonthlyLeaveBalance::where(function ($v) use($id) {
         //=====To get the Year today
         $now = Carbon::now();
         $yearnow = $now->format('Y');
         $v->where('user_id', $id);
         $v->where('year', $yearnow);
     })->orderBy('year')->get();
     $sick = MonthlyLeaveBalance::where(function ($s) use($id) {
         //=====To get the Year today
         $now = Carbon::now();
         $yearnow = $now->format('Y');
         $s->where('user_id', $id);
         $s->where('year', $yearnow);
     })->orderBy('year')->get();
     return View::make('my-leave-card')->with('months', $months)->with('vac', $vac);
 }