public function run() { $faker = Faker::create(); foreach (range(1, 10) as $index) { Rekor::create([]); } }
/** * Display a listing of the resource. * * @return Response */ public function index() { $tgl = new DateTime(date('Y-m-d')); $limit = Setting::first(); $limitdtstart = new DateTime($limit->startdayreg); $limitdtend = new DateTime($limit->enddayreg); $limitstart = $limitdtstart->diff($tgl)->format('%R%a'); $limitend = $limitdtend->diff($tgl)->format('%R%a'); $sma = Rekor::where('tingkat', 'SMA')->orderBy('urut', 'ASC')->get(); $smp = Rekor::where('tingkat', 'SMP')->orderBy('urut', 'ASC')->get(); $sd = Rekor::where('tingkat', 'SD')->orderBy('urut', 'ASC')->get(); $sponsors = Sponsor::all(); if ($limitstart < 0) { $stat = 0; return View::make('front.index')->with('stat', $stat)->with('limit', $limit)->with('sponsors', $sponsors)->with('sma', $sma)->with('smp', $smp)->with('sd', $sd); } if ($limitend > 0) { $stat = 0; return View::make('front.index')->with('stat', $stat)->with('limit', $limit)->with('sponsors', $sponsors)->with('sma', $sma)->with('smp', $smp)->with('sd', $sd); } return View::make('front.index')->with('stat', 1)->with('limit', $limit)->with('sponsors', $sponsors)->with('sma', $sma)->with('smp', $smp)->with('sd', $sd); }
/** * Remove the specified rekor from storage. * * @param int $id * @return Response */ public function destroy($id) { Rekor::destroy($id); return Redirect::route('rekors.index'); }