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