public function display(Info $qdn, $view) { $this->qdn = $qdn->with('InvolvePerson')->first(); $this->view = $view; if (Gate::allows('mod-qdn', $this->qdn->slug)) { return $this->view(); } return $this->redirectHome(); }
public static function defaultCategory($request) { $today = Carbon::now('Asia/Manila'); return Info::with('involvePerson')->where(DB::raw('YEAR(created_at)'), $today->year)->where(DB::raw('MONTH(created_at)'), $request->month)->where('discrepancy_category', $request->discrepancy)->show(0, 10)->get(); }