本文整理汇总了PHP中app\Event::lists方法的典型用法代码示例。如果您正苦于以下问题:PHP Event::lists方法的具体用法?PHP Event::lists怎么用?PHP Event::lists使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\Event
的用法示例。
在下文中一共展示了Event::lists方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index
/**
* Our index page listing all stations
*
* @author David Varney
*/
public function index(Request $request)
{
$default_event = Event::first();
$event_id = $request->input('event_id', $default_event->id);
$event = Event::find($event_id);
$stations = $event->stations()->get();
return view('admin.station_data.index', array('title' => 'Admin: Station Data', 'stations' => $stations, 'event_id' => $event_id, 'events' => Event::lists('name', 'id')));
}
示例2: run
/**
*
*/
public function run()
{
$faker = Faker::create();
$eventIds = Event::lists('id');
$userIds = User::lists('id');
foreach (range(1, 200) as $index) {
Attendance::create(['user_id' => $faker->randomElement($userIds), 'event_id' => $faker->randomElement($eventIds)]);
}
}
示例3: edit
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return Response
*/
public function edit($id)
{
$event_list = Event::lists('name', 'id');
$item = Page::findOrFail($id);
return view('page.edit')->with(['item' => $item, 'event_list' => $event_list]);
}
示例4: edit
public function edit($station_id)
{
$station = Station::find($station_id);
$events = Event::lists('name', 'id');
return view('admin.stations.edit', array('title' => 'Admin: station Edit - ' . $station->name, 'station' => $station, 'events' => $events));
}
示例5: edit
public function edit($id)
{
$event = Event::lists('evt_name', 'id')->all();
$guest = Guest::find($id);
return view('guests.edit')->with('event', $event)->with('guest', $guest);
}
示例6: edit
public function edit($id)
{
$event = Event::lists('evt_name', 'id')->all();
$attendee = Attendee::find($id);
return view('attendees.edit')->with('event', $event)->with('attendee', $attendee);
}