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


PHP Event::with方法代碼示例

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


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

示例1: index

 /**
  * Display a listing of all events
  *
  */
 public function index()
 {
     //        $events = Event::with('user')->orderBy('date_start', 'desc')->get();
     $eventsFeatured = Event::with('user')->where('feature_event', 1)->get();
     $events = $this->facebookSdk->getCurrentEvents();
     $events = json_decode(json_encode($events));
     return view('pages.events.index', compact('events', 'eventsFeatured'));
 }
開發者ID:jonbrobinson,項目名稱:aaulyp,代碼行數:12,代碼來源:EventsController.php

示例2: show

 public function show($localId)
 {
     $event = \App\Event::with('users')->where('local_id', $localId)->first();
     if (!$event) {
         return response()->json(['message' => 'Damn! You just missed it.'], 404);
     }
     return $event;
 }
開發者ID:hfalucas,項目名稱:hackacity-api,代碼行數:8,代碼來源:EventsController.php

示例3: show

 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function show($slug)
 {
     $categories = Category::lists('name', 'id');
     $events = Event::with('category')->where('slug', $slug)->first();
     $category = $events->category;
     $similarEvent = Event::where('category_id', $category->id)->where('event_date', ">", \Carbon\Carbon::now())->orderBy('created_at', 'desc')->limit(3)->get();
     return view('events.event', compact('events', 'categories', 'similarEvent'));
 }
開發者ID:elinadenfina,項目名稱:lazyNinjaEvents,代碼行數:14,代碼來源:EventController.php

示例4: isNotSoldOut

 /**
  * La fonction isSoldOut($eventId) permet de vérifier si un événement est n'est pas complet.
  * @param int $eventId - l'id de l'événement
  * @return boolean true si l'événement n'est pas complet, false sinon
  */
 public static function isNotSoldOut($eventId)
 {
     $event = Event::with('guests')->find($eventId);
     $guests = count($event->guests);
     if ($event->capacity == 0) {
         return FALSE;
     }
     return $event->capacity > $guests;
 }
開發者ID:cliengme,項目名稱:eventmanager,代碼行數:14,代碼來源:Event.php

示例5: getSingleEvent

 public function getSingleEvent(Event $event)
 {
     $events = Event::with('posts')->where('id', '=', $event->id)->paginate(10);
     SEO::setTitle("{$event->title} - Melbourne Cocoaheads");
     SEO::setDescription($event->subtitle);
     SEO::opengraph()->setUrl($event->url());
     SEO::opengraph()->setArticle(['published_time' => $event->created_at, 'modified_time' => $event->modified_at, 'expiration_time' => $event->ends_at, 'author' => 'Jesse Collis', 'section' => 'updates', 'tag' => ['updates']]);
     return view('events', ['events' => $events, 'title' => $event->title]);
 }
開發者ID:melbournecocoa,項目名稱:website,代碼行數:9,代碼來源:EventsController.php

示例6: getEvents

 public function getEvents(Request $request)
 {
     if (\Request::ajax()) {
         if (!empty($request->get('search'))) {
             $events = Event::search($request->get('search'))->with('user')->paginate(15);
         } else {
             $events = Event::with('user')->paginate(15);
         }
         return \Response::json($events);
     }
     return \Response::json(['status' => 'error'], 400);
 }
開發者ID:borovaka,項目名稱:events,代碼行數:12,代碼來源:TicketsFrontController.php

示例7: getEventByConferenceID

 /**
  * Display a listing of events given the conferenceID.
  * @return Response
  */
 public function getEventByConferenceID(Request $req, $conferenceID)
 {
     $conf = Conference::find($conferenceID);
     if (is_null($conf)) {
         return response("No conference for id {$conferenceID}.", 405);
     }
     //Select events, populate with "attendees" so we can calculate the
     //remaining capacity
     $event = Event::with("attendees")->where('conferenceID', $conferenceID)->get();
     $evtArray = $event->toArray();
     if (sizeof($evtArray) == 0) {
         return response("No events for conferenceID {$conferenceID}.", 404);
     }
     $evtArray = array_map(function ($e) use($req) {
         return $this->show($req, $e);
     }, $evtArray);
     return $evtArray;
 }
開發者ID:a161527,項目名稱:cs319-p2t5,代碼行數:22,代碼來源:Events.php

示例8: search

 public function search()
 {
     $events = new Event();
     $events = $events->with('category')->where('publish', 1);
     $title = Input::get('name', null);
     if ($title) {
         $events->where('title', 'LIKE', "%{$title}%");
     }
     if (Input::get('category_id')) {
         $events->where('category_id', Input::get('category_id'));
     }
     if (Input::get('date')) {
         $events->where('event_date', Input::get('date'));
     }
     $categories = Category::lists('name', 'id');
     $highlighted = Event::with('category')->where('highlight', 1)->where('publish', 1)->where('event_date', ">", \Carbon\Carbon::now())->orderBy('event_date', 'asc')->limit(6)->get();
     $events = $events->orderBy('event_date', 'asc')->where('event_date', ">", \Carbon\Carbon::now())->paginate(5);
     return View::make('index', compact('events', 'highlighted', 'categories'));
 }
開發者ID:elinadenfina,項目名稱:lazyNinjaEvents,代碼行數:19,代碼來源:WelcomeController.php

示例9: events

 public function events()
 {
     $events = Event::with('user')->paginate(15);
     return view('ticketsadmin::events', compact('events'));
 }
開發者ID:borovaka,項目名稱:events,代碼行數:5,代碼來源:TicketsAdminController.php

示例10: getPublishedEvent

 public function getPublishedEvent()
 {
     $event = Event::with('get_category')->where('is_published', '=', 1)->get();
     return view('events', array('events' => $event));
 }
開發者ID:ndro,項目名稱:New-GI-Website-Concept,代碼行數:5,代碼來源:HomeController.php

示例11: index

 /**
  * @return mixed
  */
 public function index()
 {
     return view('events.index')->withEvents($this->event->with('photo')->orderBy('date', 'DESC')->paginate(10));
 }
開發者ID:kinnngg-lenz,項目名稱:csacerc,代碼行數:7,代碼來源:EventsController.php

示例12: function

<?php

namespace App\ViewComposers;

use View;
use Auth;
use App\Event;
View::composer('partials.upcoming-events', function ($view) {
    // Upcoming Events (by League)
    $leagues = [(object) ['name' => 'Poker'], (object) ['name' => 'Trivia']];
    foreach ($leagues as $league) {
        $league->events = Event::with('league')->with(['league.venue' => function ($query) {
            $query->orderBy('id');
        }])->whereHas('league', function ($query) use($league) {
            $query->where('activity', $league->name);
        })->whereRaw('date(datetime) between ? and ?', [date('Y-m-d'), date('Y-m-d', time() + 60 * 60 * 24 * 7)])->whereHas('league.venue', function ($query) {
            $query->whereRaw('private is not true')->orWhereRaw('id in (select venue_id from t_venue_players where player_id=?)', [Auth::user()->id]);
        })->orderByRaw('date(datetime)')->orderByRaw('(select venue_id from t_leagues where id=league_id)')->orderByRaw('time(datetime)')->get();
    }
    // Registered Events
    $registered = Auth::user()->registeredEvents ?: [];
    $registered = array_map(function ($event) {
        return $event->id;
    }, $registered);
    // Bind Data
    $view->with('leagues', $leagues);
    $view->with('registered', $registered);
});
開發者ID:MadeByGlutard,項目名稱:GreenMountainGaming.com,代碼行數:28,代碼來源:UpcomingEventsComposer.php

示例13: indexSearch

 public function indexSearch(Request $request)
 {
     $events = Event::with('user', 'category')->searchFor($request->get('search'))->get()->toArray();
     return $this->respond($events);
 }
開發者ID:kasperbauer,項目名稱:kris,代碼行數:5,代碼來源:EventsController.php

示例14: edit

 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function edit($id)
 {
     $event = Event::with('bands', 'manager', 'article')->find($id);
     if (empty($event)) {
         Flash::error('Cet événement n\'existe pas.');
         abort(404);
     }
     return view('events.edit', compact('event'));
 }
開發者ID:Techraav,項目名稱:PolyMusic,代碼行數:15,代碼來源:EventController.php

示例15: getEvents

 public function getEvents($name)
 {
     $user = User::where('name', $name)->first();
     $user_id = $user->id;
     $oldEvents = Event::with('category')->where('user_id', $user_id)->where('event_date', "<", \Carbon\Carbon::now())->orderBy('created_at', 'desc')->get();
     $events = Event::with('category')->where('user_id', $user_id)->where('event_date', ">", \Carbon\Carbon::now())->orderBy('created_at', 'desc')->get();
     return view('admin.events', compact('events', 'user', 'oldEvents'));
 }
開發者ID:elinadenfina,項目名稱:lazyNinjaEvents,代碼行數:8,代碼來源:AdminController.php


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