本文整理汇总了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]);
}
示例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]);
}
示例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();
}
}
示例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]);
}
示例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('/');
}
示例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);
}
}
}
示例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]);
}
示例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));
}
示例9: event
public function event()
{
$this->data = array();
$this->data['event'] = Event::get();
return view('list_event', $this->data);
}
示例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);
}