本文整理汇总了PHP中Location::all方法的典型用法代码示例。如果您正苦于以下问题:PHP Location::all方法的具体用法?PHP Location::all怎么用?PHP Location::all使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Location
的用法示例。
在下文中一共展示了Location::all方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
public function run()
{
$faker = Faker::create();
foreach (range(1, 20) as $index) {
CalendarEvent::create(['event_name' => $faker->bs, 'creator_id' => User::all()->random()->id, 'location_id' => Location::all()->random()->id, 'start_time' => $faker->time, 'end_time' => $faker->time, 'cost' => $faker->numberBetween($min = 25, $max = 500), 'description' => $faker->text($maxNbChars = 200), 'event_image' => $faker->image]);
}
}
示例2: getMasterDatas
private function getMasterDatas()
{
$data['categories'] = Category::orderBy('title')->get();
View::share('categories', $data['categories']);
$data['locations'] = Location::all();
View::share('locations', $data['locations']);
}
示例3: create
/**
* Show the form for creating a new order
*
* @return Response
*/
public function create()
{
$items = Item::all();
$customers = Client::all();
$locations = Location::all();
return View::make('orders.create', compact('items', 'locations', 'customers'));
}
示例4: action_edit
public function action_edit($id)
{
if (Auth::check() && Session::has('id')) {
$account = Account::find(Session::get('id'));
$location = Location::find($id);
if (Input::has('address') && Input::has('city') && Input::has('postal_code')) {
if ($account->id == $location->account_id) {
Input::has('address') ? $location->address = strip_tags(Input::get('address')) : ($location->address = '');
Input::has('city') ? $location->city = strip_tags(Input::get('city')) : ($location->city = '');
Input::has('postal_code') ? $location->postal_code = strip_tags(Input::get('postal_code')) : ($location->postal_code = '');
$location->save();
return Redirect::to("/account/myLocations");
} else {
return Redirect::to("/account/myLocations");
}
} else {
if ($location->account_id == $account->id) {
$locations = Location::all();
$view = View::make('location.edit.index')->with('title', 'Edit Location')->with('location', $location)->with('locations', $locations);
return $view;
} else {
return Response::error('403');
}
}
} else {
return Redirect::to('/');
}
}
示例5: locations
public function locations()
{
$locations = Location::all();
$organization = Organization::find(1);
$pdf = PDF::loadView('erpreports.locationsReport', compact('locations', 'organization'))->setPaper('a4')->setOrientation('potrait');
return $pdf->stream('Stores List.pdf');
}
示例6: index
public function index()
{
$rooms = Room::all();
$locations = Location::all();
$menu = 'data';
return View::make('rooms.index', compact('rooms', 'locations', 'menu'));
}
示例7: down
/**
* Revert the changes to the database.
*
* @return void
*/
public function down()
{
//
$locations = Location::all();
foreach ($locations as $location) {
$location->delete();
}
}
示例8: create
public function create()
{
$locations = Location::all();
$courses = Course::where('location_id', '=', Auth::user()->location_id)->get();
$employees = Employee::all();
$menu = 'student';
return View::make('movements.create', compact('locations', 'courses', 'employees', 'menu'));
}
示例9: index
public function index()
{
$users = User::all();
$employees = Employee::all();
$locations = Location::all();
$menu = 'data';
return View::make('users.index', compact('users', 'employees', 'locations', 'menu'));
}
示例10: edit
public function edit($id)
{
$activity = Activity::find($id);
$generations = Generation::all();
$locations = Location::all();
$menu = 'project';
return View::make('activities.edit', compact('activity', 'generations', 'locations', 'menu'));
}
示例11: familyLoc
public static function familyLoc($family)
{
$flocations = [];
foreach ($family as $f) {
$l = \Location::all(["user_id = ?" => $f->user_id], ["*"], "created", "desc");
$flocations = array_merge($flocations, $l);
}
return $flocations;
}
示例12: index
public function index()
{
$currProject = Auth::user()->curr_project_id;
$currLocation = Auth::user()->location_id;
$projects = Project::all();
$locations = Location::all();
$menu = 'setup';
return View::make('setups/index', compact('projects', 'locations', 'currProject', 'currLocation', 'menu'));
}
示例13: create
/**
* Show the form for creating a new resource.
* GET /calendarevents/create
*
* @return Response
*/
public function create()
{
$locations = Location::all();
$dropdown = [];
$dropdown['-1'] = 'Add New Address';
foreach ($locations as $location) {
$dropdown[$location->id] = $location->title;
}
return View::make('events.create')->with('dropdown', $dropdown);
}
示例14: create
/**
* Show the form for creating a new resource.
*
* @return Response
*/
public function create()
{
$donors = [''] + Donor::all()->lists('name_with_blood_group', 'id');
$products = [''];
foreach (Category::all() as $cat) {
$cat_products = $cat->products->lists('name', 'id');
$products[$cat->name] = $cat_products;
}
$locations = [''] + Location::all()->lists('name_with_parent', 'id');
return View::make('donations.create', ['donors' => $donors, 'products' => $products, 'locations' => $locations, 'today' => Carbon\Carbon::now()]);
}
示例15: allLocations
public function allLocations()
{
$new = array();
$locations = Location::all();
foreach ($locations as $location) {
$ven = Vendor::find($location->vendor_id);
$location['logo_path'] = $ven->logo_path;
array_push($new, $location);
}
$data = array('status' => 'ok', 'locations' => $new);
return $data;
}