本文整理汇总了PHP中app\Location::lists方法的典型用法代码示例。如果您正苦于以下问题:PHP Location::lists方法的具体用法?PHP Location::lists怎么用?PHP Location::lists使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\Location
的用法示例。
在下文中一共展示了Location::lists方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: edit
public function edit($id)
{
$activity = Activity::find($id);
$cars = Car::lists('name', 'id');
$customers = Customer::lists('name', 'id');
$locations = Location::lists('name', 'id');
$costs = null;
$items = null;
$ondayOtherCosts = null;
if ($activity->type == "On Day") {
$data = Onday::where('activity_id', '=', $id)->get()->pop();
$ondayOtherCosts = OndayOtherCost::where('onday_id', $data->id)->get();
} else {
if ($activity->type == "Maintenance") {
$data = Maintenance::where('activity_id', '=', $id)->get()->pop();
$costs = $activity->maintenance->items;
$items = Item::lists('name', 'id')->sort();
} else {
if ($activity->type == "Nil") {
$data = Nil::where('activity_id', '=', $id)->get()->pop();
}
}
}
return view('activity.edit', ['activity' => $activity, 'data' => $data, 'cars' => $cars, 'customers' => $customers, 'locations' => $locations, 'costs' => $costs, 'items' => $items, 'ondayOtherCosts' => $ondayOtherCosts]);
}
示例2: doChooseEmployee
/**
* User chose single employee from dropdown to be edited
*
* @param Request $request
* @return mixed
*/
public function doChooseEmployee(Request $request)
{
$employee = Employee::find($request->input('choose'));
$dept = ['' => 'Choose...'] + Department::lists('name', 'id')->all();
$location = ['' => 'Choose...'] + Location::lists('name', 'id')->all();
return view('admin.edit-employee', compact('dept', 'location', 'employee'));
}
示例3: addProducts
public function addProducts($id)
{
$requesition = $this->requesition->with(['items'])->where('id', $id)->first();
$locations = Location::lists('name', 'id');
$locationLists = [null => trans('main.label.select')];
if ($locations != null) {
$locationLists = $locationLists + $locations->toArray();
}
return view('requesitions.add_product', ['requesition' => $requesition, 'items' => $requesition->items, 'locationLists' => $locationLists]);
}
示例4: processOndayFormView
public function processOndayFormView()
{
$activities = Activity::orderBy('created_at', 'desc')->take(10)->get();
$customers = Customer::lists('name', 'id');
$locations = Location::lists('name', 'id')->sort();
$activity = Session::get('activity');
$ondayOtherCostItems = OndayOtherCostItem::lists('name', 'id');
// Session::forget('activity');
return view('home', ['type' => '1', 'activity' => $activity, 'customers' => $customers, 'locations' => $locations, 'activities' => $activities, 'ondayOtherCostItems' => $ondayOtherCostItems]);
}
示例5: scraper
/**
* Show the application welcome screen to the user.
*
* @return Response
*/
public function scraper()
{
$success = '';
$groups = Group::lists('name', 'group_id');
$locations = Location::lists('location', 'location_id');
//$tournaments = Tournament::orderBy('start_date', 'desc')
// ->lists('name','tournament_id');
$tournaments = Tournament::selectRaw('CONCAT(name, " (", start_date, ")") as name, tournament_id')->orderBy('start_date', 'desc')->lists('name', 'tournament_id');
$players = Player::select('first_name', 'last_name', 'player_id', \DB::raw('CONCAT(first_name, " ", last_name) as full_name'))->orderBy('first_name')->orderBy('last_name')->get()->lists('full_name', 'player_id');
return view('admin.scraper', compact('groups', 'locations', 'tournaments', 'players', 'success'));
}
示例6: run
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
$faker = Faker\Factory::create();
$locations = Location::lists('id')->all();
$limit = 3;
foreach ($locations as $location) {
for ($i = 0; $i < $limit; $i++) {
DB::table('stories')->insert(['location_id' => $location, 'title' => $faker->sentence, 'story' => $faker->text, 'published' => $faker->boolean]);
}
}
}
示例7: addProducts
public function addProducts($id)
{
$receive = Receive::with(['receiveItems', 'receiveItems.product', 'receiveItems.product.unit'])->whereId($id)->whereStatus(Receive::CREATE)->first();
if ($receive == null) {
flash()->error(trans('receive.label.name'), trans('receive.message_alert.warning_receive_is_not_create'));
return redirect()->back();
}
$locations = Location::lists('name', 'id');
$locationLists = [null => trans('main.label.select')];
if ($locations != null) {
$locationLists = $locationLists + $locations->toArray();
}
$receiveItems = $receive->receiveItems()->orderBy('id', 'asc')->get();
return view('receives.add_product', compact('receive', 'products', 'locationLists', 'receiveItems'));
}
示例8: create
/**
* Show the form for creating a new resource.
*
* @return \Illuminate\Http\Response
*/
public function create()
{
$locations = App\Location::lists('name', 'id');
$subcontractors = App\Subcontractor::lists('subcontractor_name', 'id');
return view('assignments.create', compact('locations', 'locations', 'subcontractors', 'subcontractors'));
}
示例9: edit
public function edit($id)
{
$chart = Chart::findOrFail($id);
$locations = Location::lists('name', 'id');
$units = ChartUnit::lists('unit', 'id');
$types = ChartType::lists('type', 'id');
$auth = $chart->auth;
$visible = $chart->visible;
return view('partials.editChart', compact('chart', 'locations', 'units', 'types', 'auth', 'visible'));
}
示例10: index
public function index()
{
JavaScript::put(['loggedIn' => Auth::check()]);
$locations = Location::lists('name', 'id');
return View::make('home', compact('locations'));
}
示例11: edit
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return Response
*/
public function edit($id)
{
$locations = Location::lists('name', 'id');
$payment_methods = Payment_Method::lists('name', 'id');
$all_memberships = Membership::orderBy('created_at', 'desc')->get();
$memberships = $all_memberships->lists('name', 'id');
$admins = User::Admins()->get();
$supervisors = $admins->lists('fullname', 'id');
$instructors = User::Instructors()->get()->lists('fullname', 'id');
$class = Classe::findOrFail($id);
return view('classes.edit', compact('class', 'locations', 'payment_methods', 'supervisors', 'memberships', 'instructors'));
}