/** * Main paige of dashboard. */ public function index() { //get grace period form DB, if exists show it in view $gp = GracePeriod::first(); //add here data which we can render in view $dataToView = array('grace_settings' => $gp ? $gp->days . 'd ' . $gp->hours . 'h ' . $gp->minutes . 'm' : null); return View::make('dashboard.index', $dataToView); }
/** * Remove the specified graceperiod from storage. * * @param int $id * @return Response */ public function destroy($id) { GracePeriod::destroy($id); return Redirect::route('graceperiods.index'); }