コード例 #1
0
 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function show($id)
 {
     $event = Event::where(compact('id'))->first();
     return view('admin.pages.events.show', compact('event'));
 }
コード例 #2
0
 /**
  * Returns an event based on current date
  *
  * @return \FishingFestival\Models\Events\Event
  */
 public static function assign()
 {
     $today = (new Carbon())->toDateString();
     return Event::where('start_date', '<=', $today)->where('end_date', '>=', $today)->first();
 }