当前位置: 首页>>代码示例>>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;未经允许,请勿转载。