public function filter($month, $year) { $curr_month = $month; $curr_year = $year; $payrolls = Payroll::where('location_id', '=', Auth::user()->location_id)->where(DB::raw('year(release_date)'), '=', $curr_year)->where(DB::raw('month(release_date)'), '=', $curr_month)->get(); $menu = 'employee'; return View::make('payrolls.index', compact('payrolls', 'curr_month', 'curr_year', 'menu')); }
public function createUserPayrollDetails() { $all = Input::all(); $pay = Payroll::where('user_id', '=', $all['user_id']); if (count($pay->get()) > 0) { $pay->update($all); } else { Payroll::create($all); } return Response::jsend('success', 'Users Payroll successfully created.'); }