本文整理汇总了PHP中app\models\Location::states方法的典型用法代码示例。如果您正苦于以下问题:PHP Location::states方法的具体用法?PHP Location::states怎么用?PHP Location::states使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\models\Location
的用法示例。
在下文中一共展示了Location::states方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: create
public function create($category = 0)
{
$category = intval($category);
if ($category > 0) {
$category = Category::findOrFail($category);
}
$categories = Category::roots()->get();
$user = Auth::user();
$states = Location::states()->first();
$regions = $states->children()->first();
$locations = $regions->children;
return view('pages.task.create', compact('category', 'categories', 'user', 'locations'));
}
示例2: create
public function create()
{
$pid = intval(Input::get('id', 0));
if ($pid != 0) {
$location = Location::findOrFail($pid);
if ($location->pid == 0) {
$parents = Location::states()->get();
} else {
$parents = $location->siblings();
}
} else {
$location = false;
$parents = Location::states()->get();
}
return view('admin.pages.location.add', compact('location', 'parents', 'pid'));
}
示例3: getFill
public function getFill()
{
if (!$this->checkProfileType()) {
return redirect('/profile');
}
if ($this->checkProfileFill()) {
return redirect('/profile');
}
$user = $this->user;
$profile = $this->user->profile;
$city = $profile->city;
if ($city) {
$region = $city->parent;
} else {
$region = Location::states()->first()->children()->first();
}
$cities = $region->children;
$categories = Category::roots()->get();
$subscribePeriods = ['asap', 'hour', 'twice-day', 'day', 'two-days'];
return view('pages.profile.fill', compact('user', 'profile', 'cities', 'categories', 'subscribePeriods'));
}
示例4: getRegisterTasker
public function getRegisterTasker()
{
$states = Location::states()->get();
$regions = $states->first()->children;
$cities = $regions->first()->children;
$citiesArr = ['' => trans('register.city.placeholder')];
$regionsArr = [];
$statesArr = [];
foreach ($cities as $s) {
$citiesArr[$s->id] = $s->title;
}
foreach ($regions as $s) {
$regionsArr[$s->id] = $s->title;
}
foreach ($states as $s) {
$statesArr[$s->id] = $s->title;
}
$cities = $citiesArr;
$states = $statesArr;
$regions = $regionsArr;
return view('pages.register.tasker', compact('states', 'regions', 'cities'));
}