當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。