本文整理汇总了PHP中app\Event::select方法的典型用法代码示例。如果您正苦于以下问题:PHP Event::select方法的具体用法?PHP Event::select怎么用?PHP Event::select使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\Event
的用法示例。
在下文中一共展示了Event::select方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getCalendar
public function getCalendar()
{
$eventos = Event::select('titulo_evento')->where('user_id', '=', Auth::user()->id)->take(4)->get();
//$datos['cTrabajo']= \DB::table('trabajo')->count();
$array = Event::where('user_id', '=', Auth::user()->id)->get();
return view('Calendar/calendar', compact('array', 'datos', 'eventos'));
}
示例2: eventsUsuari
public static function eventsUsuari($cultius)
{
if (!is_null($cultius)) {
// foreach ($cultius as $cultiu){
// dd($cultiu);
if (!is_null($cultius)) {
$results = Event::select('id', 'headline', 'text', 'startDate', 'cultiu_id')->where(function ($query) use($cultius) {
foreach ($cultius as $value) {
if (!is_null($value)) {
//you can use orWhere the first time, dosn't need to be ->where
$query->orWhere('cultiu_id', $value['id']);
}
}
})->orderBy('updated_at', 'desc')->get()->toArray();
foreach ($results as $passa) {
$dades[] = $passa;
}
}
//}
}
//dd($dades);
if (!is_null($dades)) {
return $dades;
}
}
示例3: events
public function events(Request $request)
{
if ($request->start && $request->end) {
return Event::whereRaw("start between '" . $request->start . "' and '" . $request->end . "'")->with("order")->get();
} else {
return Event::select("*")->get();
}
}
示例4: overview
/**
* Display events that require CERFs.
*
* @return \Illuminate\View\View
*/
public function overview()
{
// Ensures only events created after implementation of online CERFs system are checked.
$oldestAllowed = Carbon::create(2015, 11, 1, 8, 0, 0, 'UTC');
$newestAllowed = Carbon::now();
// Finds IDs of all events that do not have an associated approved CERF.
$eventIdsWithoutCerfs = Event::select('events.id')->leftJoin('cerfs', 'events.id', '=', 'cerfs.event_id')->whereNull('cerfs.id')->orWhere('cerfs.approved', false)->get();
// TODO Paginate events that need to be CERFed.
// Retrieves events without CERFs based on ID. Casts to array to pass to foreach loop in view.
$eventsWithoutCerfs = Event::find($eventIdsWithoutCerfs->toArray());
$userCerfs = Cerf::where('reporter_id', Auth::id())->where('approved', false)->get();
return view('pages.cerfs.overview', compact('eventsWithoutCerfs', 'userCerfs', 'oldestAllowed', 'newestAllowed'));
}
示例5: 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]);
}
示例6: getTittlesEvents
public function getTittlesEvents()
{
$eventos = Event::select('titulo_evento')->where('user_id', '=', Auth::user()->id)->take(4)->get();
return $eventos;
}
示例7: index
/**
* View a list of events.
* @return mixed
*/
public function index()
{
$events = Event::select('events.*')->join('event_times', 'events.id', '=', 'event_times.event_id')->orderBy('event_times.start', 'DESC')->distinct()->distinctPaginate(15);
$this->checkPagination($events);
return View::make('events.index')->withEvents($events);
}
示例8: editEventInfo
/**
* Show the form for editing an existing event's info.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function editEventInfo($id)
{
$event = Event::select('events.*')->where('id', '=', $id)->firstorfail();
return view('admin/edit', ['event' => $event]);
}