當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Event::first方法代碼示例

本文整理匯總了PHP中app\Event::first方法的典型用法代碼示例。如果您正苦於以下問題:PHP Event::first方法的具體用法?PHP Event::first怎麽用?PHP Event::first使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在app\Event的用法示例。


在下文中一共展示了Event::first方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: index

 /**
  * Our index page listing all stations
  *
  * @author David Varney
  */
 public function index(Request $request)
 {
     $default_event = Event::first();
     $event_id = $request->input('event_id', $default_event->id);
     $event = Event::find($event_id);
     $stations = $event->stations()->get();
     return view('admin.station_data.index', array('title' => 'Admin: Station Data', 'stations' => $stations, 'event_id' => $event_id, 'events' => Event::lists('name', 'id')));
 }
開發者ID:davidvarney,項目名稱:tagmovement,代碼行數:13,代碼來源:StationDataController.php

示例2: tearDown

 protected function tearDown()
 {
     if (is_null($this->lastEvent)) {
         $event = Event::first();
         if (!is_null($event)) {
             $event->delete();
         }
     } else {
         Event::where('eid', '>', $this->lastEvent)->delete();
     }
     User::where('uid', $this->user->uid)->delete();
 }
開發者ID:umSoftEng2GrpE,項目名稱:partEZ,代碼行數:12,代碼來源:EventTest.php

示例3: index

 /**
  * Show the application dashboard.
  *
  * @return Response
  */
 public function index()
 {
     try {
         $isInstalled = Setting::where('name', 'is_installed')->firstOrFail();
     } catch (ModelNotFoundException $e) {
         $isInstalled = Setting::create(['name' => 'is_installed', 'setting' => 'no']);
     }
     if ($isInstalled->setting != 'yes') {
         return Redirect::route('install');
     }
     $data = ["event" => Event::first(), "upcomingEvents" => Event::take(3)->get(), "news" => News::take(6)->get(), "media" => Media::where('processed', true)->orderBy('id', 'DESC')->take(12)->get()];
     return view('home')->with($data);
 }
開發者ID:TheJokersThief,項目名稱:Eve,代碼行數:18,代碼來源:HomeController.php

示例4: calendar

 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function calendar()
 {
     $events = [];
     $getevents = Event::all();
     foreach ($getevents as $event) {
         $events[] = \Calendar::event($event->titl, false, new \DateTime($event->start), new \DateTime($event->end), $event->event_id);
     }
     $events[] = \Calendar::event('Event One', false, '2015-11-11T0800', '2015-11-12T0800', 0);
     $events[] = \Calendar::event("Valentine's Day", true, new \DateTime('2015-11-14'), new \DateTime('2015-11-14'), 'stringEventId');
     $eloquentEvent = Event::first();
     //Event implements MaddHatter\LaravelFullcalendar\Event
     $calendar = \Calendar::addEvents($events);
     return view('calendar', compact('calendar'));
 }
開發者ID:omarzoundri,項目名稱:outdoorxl-cloud,代碼行數:19,代碼來源:EventController.php

示例5: home

 /**
  * Adds an opportunity to pass any data from models
  *
  * @author David Varney
  */
 public function home()
 {
     return view('layouts.frontend_app', array('states' => FormHelper::get_states(), 'graduation_years' => FormHelper::get_graduation_years(), 'genders' => FormHelper::get_genders(), 'shirt_sizes' => FormHelper::get_shirt_sizes(), 'event_id' => Event::first()->id));
 }
開發者ID:davidvarney,項目名稱:tagmovement,代碼行數:9,代碼來源:HomeController.php


注:本文中的app\Event::first方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。