当前位置: 首页>>代码示例>>PHP>>正文


PHP Event::get方法代码示例

本文整理汇总了PHP中app\Event::get方法的典型用法代码示例。如果您正苦于以下问题:PHP Event::get方法的具体用法?PHP Event::get怎么用?PHP Event::get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在app\Event的用法示例。


在下文中一共展示了Event::get方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: showHomePage

 public function showHomePage(Request $r)
 {
     $var = $this->getVars();
     $content = array();
     $content["services"] = Content::where('type', '=', 'services')->get();
     $content["fields"] = Content::where('type', '=', 'fields')->get();
     $events = Event::get();
     $content["blogs"] = Content::where('type', '=', 'blogs')->orderBy("date_created", "desc")->take(3)->get();
     $content["members"] = Member::orderBy('position', 'desc')->get();
     $content["didactics"] = Content::where('type', '=', 'didactics')->orderBy("date_created", "desc")->take(3)->get();
     $content["resources"] = Content::where('type', '=', 'resources')->orderBy("date_created", "desc")->take(3)->get();
     $content["galleries"] = Content::where('type', '=', 'galleries')->orderBy("date_created", "desc")->take(3)->get();
     $content["companies"] = Content::where('type', '=', 'companies')->orderBy("date_created", "desc")->get();
     $content["researchesours"] = Content::where('type', '=', 'researches')->whereHas('research', function ($query) {
         $query->where('external', 0);
     })->orderBy("date_created", "desc")->take(2)->get();
     $content["researchesexternal"] = Content::where('type', '=', 'researches')->whereHas('research', function ($query) {
         $query->where('external', 1);
     })->orderBy("date_created", "desc")->take(2)->get();
     $services = Content::where('type', '=', 'services')->get();
     //        dd($content);
     $lang = $r->session()->get("lang", "fa");
     //        if($lang == "en")
     //            return view("testhome",["content" => $content, "var" => $var, "lang" => $lang]);
     return view('home', ["content" => $content, "var" => $var, "lang" => $lang]);
 }
开发者ID:ariiiaaaaan,项目名称:sbu_testlab,代码行数:26,代码来源:HomeController.php

示例2: index

 public function index()
 {
     $events = \App\Event::get();
     $sliders = \App\Slider::get();
     $services = \App\Service::get();
     $site = \App\Site::where('active', '1')->firstOrFail();
     return view('pages.index', ['events' => $events, 'sliders' => $sliders, 'services' => $services, 'site' => $site]);
 }
开发者ID:MammutCris,项目名称:Josse,代码行数:8,代码来源:IndexController.php

示例3: down

 /**
  * Reverse the migrations.
  *
  * @return void
  */
 public function down()
 {
     $events = Event::get();
     // Get all the current events and attribute them to manchester (MCR).
     foreach ($events as $event) {
         $event->city_id = null;
         $event->save();
     }
 }
开发者ID:EMT,项目名称:see-do,代码行数:14,代码来源:2016_02_16_111307_attribute_all_events_to_mcr.php

示例4: editForm

 public function editForm()
 {
     $eventNames = \App\Event::get()->pluck('name', 'id')->toArray();
     $mediaNames = \App\Media::get()->pluck('name', 'id')->toArray();
     $eventIDs = \App\Event::get()->pluck('id')->toArray();
     $mediaIDs = \App\Media::get()->pluck('id')->toArray();
     $mediaToEvents = array();
     $eventToMedia = array();
     foreach ($eventIDs as $eventID) {
         $eventToMedia[$eventID] = \App\Media::join('event_media', 'media.id', '=', 'event_media.mediaID')->where('event_media.eventID', $eventID)->get()->pluck('name', 'id')->toArray();
     }
     foreach ($mediaIDs as $mediaID) {
         $mediaToEvents[$mediaID] = \App\Event::join('event_media', 'events.id', '=', 'event_media.eventID')->where('event_media.mediaID', $mediaID)->get()->pluck('name', 'id')->toArray();
     }
     return view('forms/editRelationships')->with(['eventNames' => $eventNames, 'mediaNames' => $mediaNames, 'eventToMedia' => $eventToMedia, 'mediaToEvents' => $mediaToEvents]);
 }
开发者ID:erikkacsm,项目名称:timeline,代码行数:16,代码来源:RelationshipController.php

示例5: edit

 public function edit($id, Requests\EditEventRequest $request)
 {
     $event = \App\Event::get()->where('id', intval($id))->toArray();
     if (empty($event)) {
         App:
         abort(404);
     }
     $data = $request->all();
     $tags = $data['tags'];
     if ($data['summary'] == '') {
         $data['summary'] = NULL;
     }
     unset($data['_token']);
     unset($data['tags']);
     \App\EventTag::where('eventID', intval($id))->delete();
     foreach ($tags as $tag) {
         \App\EventTag::create(['eventID' => intval($id), 'tag' => $tag]);
     }
     \App\Event::where('id', $id)->update($data);
     return redirect('/');
 }
开发者ID:erikkacsm,项目名称:timeline,代码行数:21,代码来源:EventController.php

示例6: dept

 public function dept()
 {
     if (Auth::user()->position->id == 1) {
         $this->data['items'] = Score::where('userid', Auth::id())->get();
         return view('pages.viewmark.staff', $this->data);
     } else {
         if (Request::isMethod('get')) {
             $this->data['events'] = Event::get();
             $this->data['staffs'] = null;
             return view('pages.viewmark.yes', $this->data);
         } else {
             // dd(Input::all());
             $this->data['events'] = Event::get();
             $user = Score::where('eventid', Input::get('event'))->get();
             foreach ($user as $key => $value) {
                 if ($value->user->deptid != Auth::user()->deptid) {
                     unset($user[$key]);
                 }
             }
             $this->data['staffs'] = $user;
             return view('pages.viewmark.yes', $this->data);
         }
     }
 }
开发者ID:bilfash,项目名称:monstaff,代码行数:24,代码来源:ViewMarkController.php

示例7: index

 public function index()
 {
     /* Get data for timeline */
     $eventDates = \App\Event::select('timelineDate')->distinct()->get()->pluck('timelineDate')->toArray();
     $mediaDates = \App\Media::select('timelineDate')->distinct()->get()->pluck('timelineDate')->toArray();
     $dates = array_unique(array_merge($eventDates, $mediaDates), SORT_REGULAR);
     usort($dates, array('\\App\\Http\\Controllers\\TimelineController', 'dateCompare'));
     $media = array();
     $events = array();
     foreach ($dates as $date) {
         $eventsForThisDate = \App\Event::get()->where('timelineDate', $date)->toArray();
         $mediaForThisDate = \App\Media::get()->where('timelineDate', $date)->toArray();
         usort($eventsForThisDate, array('\\App\\Http\\Controllers\\TimelineController', 'itemCompare'));
         usort($mediaForThisDate, array('\\App\\Http\\Controllers\\TimelineController', 'itemCompare'));
         $media[$date] = $mediaForThisDate;
         $events[$date] = $eventsForThisDate;
     }
     /* Get data for filters */
     $mediums = \App\Media::select('medium')->distinct()->get()->pluck('medium')->toArray();
     $tags = \App\EventTag::select('tag')->distinct()->get()->pluck('tag')->toArray();
     $series = \App\Series::get()->pluck('seriesAbbreviation');
     sort($mediums);
     sort($tags);
     $eventIDToTags = array();
     $eventIDs = \App\Event::get()->pluck('id');
     foreach ($eventIDs as $eventID) {
         $eventIDToTags[$eventID] = \App\EventTag::select('tag')->where('eventID', $eventID)->get()->pluck('tag')->toArray();
     }
     $seriesToCollections = array();
     foreach ($series as $thisSeries) {
         $seriesToCollections[$thisSeries] = \App\Media::select('collection')->where('series', $thisSeries)->distinct()->get()->pluck('collection')->toArray();
     }
     /* Get event-media relationships */
     $eventMediaPairs = \App\EventMedia::get(array('eventID', 'mediaID'))->toArray();
     return view('timeline')->with(['seriesToCollections' => $seriesToCollections, 'eventMediaPairs' => $eventMediaPairs, 'eventIDToTags' => $eventIDToTags, 'mediums' => $mediums, 'events' => $events, 'dates' => $dates, 'media' => $media, 'tags' => $tags]);
 }
开发者ID:erikkacsm,项目名称:timeline,代码行数:36,代码来源:TimelineController.php

示例8: index

 /**
  * Our index page listing all users
  *
  * @author David Varney
  */
 public function index()
 {
     $events = Event::get();
     return view('admin.events.index', array('title' => 'Admin: Events', 'events' => $events));
 }
开发者ID:davidvarney,项目名称:tagmovement,代码行数:10,代码来源:EventsController.php

示例9: event

 public function event()
 {
     $this->data = array();
     $this->data['event'] = Event::get();
     return view('list_event', $this->data);
 }
开发者ID:ryujikun,项目名称:bridge,代码行数:6,代码来源:HomeController.php

示例10: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $this->data['event'] = Event::get();
     return view('admin.event.manage', $this->data);
 }
开发者ID:ryujikun,项目名称:bridge,代码行数:10,代码来源:EventController.php


注:本文中的app\Event::get方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。