当前位置: 首页>>代码示例>>PHP>>正文


PHP Location::all方法代码示例

本文整理汇总了PHP中app\Location::all方法的典型用法代码示例。如果您正苦于以下问题:PHP Location::all方法的具体用法?PHP Location::all怎么用?PHP Location::all使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在app\Location的用法示例。


在下文中一共展示了Location::all方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: edit

 public function edit($id)
 {
     $request = Request::with(['equipment', 'area', 'location', 'category', 'uploads', 'approvers', 'status', 'actions' => function ($query) {
         $query->orderBy('created_at', 'desc');
     }, 'actions.submitted', 'comments.author' => function ($query) {
         $query->orderBy('created_at', 'asc');
     }])->find($id);
     if (is_null($request)) {
         return view('security.not-found');
     }
     $data['request'] = $request;
     $data['areas'] = Area::all(['id', 'name']);
     $data['organizations'] = Organization::all();
     $data['categories'] = Category::all(['id', 'name']);
     $data['locations'] = Location::all(['id', 'name']);
     $data['approvers'] = Approval::getRecent($id);
     $data['hasApproved'] = Approval::hasApproved($id)->exists();
     if ($request->Status->name == 'Approved') {
         return view('request.view', $data);
     }
     if ($request->submitted_by != Auth::User()->id && !Auth::User()->hasRole(['administrator', 'approver'])) {
         return view('security.401');
     }
     return view('request.edit', $data);
 }
开发者ID:gfdeveloper,项目名称:LCCB,代码行数:25,代码来源:LCCBController.php

示例2: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $locations = Location::all()->toArray();
     /*$receptionist = Receptionist::where('role_id', '=', 3)->get();*/
     $receptionist = DB::table('users')->where('users.role_id', '=', 3)->join('locations', 'users.location_id', '=', 'locations.id')->get(['users.*', 'locations.name as location']);
     return Response::json(array('allreceptionists' => $receptionist, 'locations' => $locations));
 }
开发者ID:subhadip-sahoo,项目名称:laravel,代码行数:12,代码来源:ReceptionistController.php

示例3: index

 public function index(Manager $fractal, LocationTransformer $locationTransformer)
 {
     // show all
     $records = Location::all();
     $collection = new Collection($records, $locationTransformer);
     $data = $fractal->createData($collection)->toArray();
     return $this->respond($data);
 }
开发者ID:wyrover,项目名称:lenda-api,代码行数:8,代码来源:LocationsController.php

示例4: postDeleteLocation

 public function postDeleteLocation(Request $request)
 {
     $locationId = intval($request->input('location_id'));
     if ($locationId) {
         Location::find($locationId)->delete();
         return response(Location::all());
     }
     return redirect('dashboard/locations')->withErrors('No location id passed');
 }
开发者ID:silentlagoon,项目名称:kicker-rating,代码行数:9,代码来源:LocationsController.php

示例5: edit

 public function edit($partnerID)
 {
     if (!Auth::check() || !Auth::user()->is_admin) {
         return response(view('errors.403', ['error' => $this->errorMessages['incorrect_permissions']]), 403);
     }
     $partner = Partner::where('id', $partnerID)->firstOrFail();
     return view('partners.edit', ['partner' => $partner], ['locations' => Location::all()]);
     //return view('partners.edit')->with(['partner'=>$partner]);
 }
开发者ID:TheJokersThief,项目名称:Eve,代码行数:9,代码来源:PartnersController.php

示例6: create

 /**
  * Show the form for creating a new resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function create()
 {
     $locations = Location::all()->lists('project_id');
     $project_list = Project::where('id', '>', '1');
     foreach ($locations as $location) {
         $project_list = $project_list->where('id', '!=', $location);
     }
     $project_list = $project_list->lists('name', 'id')->toArray();
     return view('pages.add-location', compact('project_list'));
 }
开发者ID:botlax,项目名称:talalcontracting,代码行数:15,代码来源:LocationController.php

示例7: edit

 public function edit($id)
 {
     $locations = Location::all();
     $options = array();
     foreach ($locations as $location) {
         $options[$location->name] = $location->description;
     }
     $user = FbUser::where('id', $id)->firstOrFail();
     return view('facebook.user.edit')->with('options', $options)->with('user', $user);
 }
开发者ID:QuangBGT,项目名称:kos,代码行数:10,代码来源:FbUserController.php

示例8: handle

 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function handle()
 {
     $this->comment(sprintf("Deleting %d products and %d locations", Product::count(), Location::count()));
     Product::all()->each(function ($doc) {
         $doc->delete();
     });
     Location::all()->each(function ($doc) {
         $doc->delete();
     });
 }
开发者ID:baudday,项目名称:sagar,代码行数:15,代码来源:DataRollback.php

示例9: create

 /**
  * Show the form for creating a new resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function create()
 {
     $total = Location::all()->count();
     $used = Location::has('targets')->count();
     $free = $total - $used;
     if ($free < 5) {
         return redirect('/locations');
     }
     $location = Location::pickUnused(1);
     return view('experiments.create', compact('location', 'free'));
 }
开发者ID:acuccia,项目名称:remote-viewing,代码行数:16,代码来源:ExperimentsController.php

示例10: edit

 public function edit($id)
 {
     $locations = Location::all();
     $options = array();
     foreach ($locations as $location) {
         $options[$location->name] = $location->description;
     }
     $group = FbGroup::where('id', $id)->firstOrFail();
     $tags = Tag::all();
     return view('facebook.group.edit')->with('tags', $tags)->with('options', $options)->with('group', $group);
 }
开发者ID:QuangBGT,项目名称:kos,代码行数:11,代码来源:FbGroupController.php

示例11: index

 public function index()
 {
     $totalNumber = 5;
     // number of items to take for each section
     $data = ["events" => Event::where('end_datetime', '>', date(time()))->get()->take($totalNumber), "partners" => Partner::all()->take($totalNumber), "news" => News::all()->take($totalNumber), "media" => Media::where('processed', 0)->get()->take($totalNumber * 2)->chunk(3), "staffs" => User::where('is_staff', 1)->get(), "locations" => Location::all()->take($totalNumber)];
     $i = 0;
     foreach ($data['events'] as $event) {
         $mediaCount = count(Media::where('processed', false)->where('event_id', $event->id)->get());
         $data['events'][$i]->mediaCount = $mediaCount;
         $i++;
     }
     return View::make('admin.index')->with($data);
 }
开发者ID:TheJokersThief,项目名称:Eve,代码行数:13,代码来源:AdminController.php

示例12: index

 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $user = Session::get('user');
     $allowed_departments = Session::get('allowed_departments');
     $match_departments = Session::get('match_departments');
     $playlists = Playlist::whereIn('department_id', $match_departments)->get();
     // Return all locations or only the ones th user is assigned to
     if ($user->is_super_user) {
         $locations = Location::all();
     } else {
         $locations = Location::whereIn('department_id', $match_departments)->get();
     }
     $data = array('locations' => $locations, 'allowed_departments' => $allowed_departments, 'user' => $user, 'playlists' => $playlists);
     return view('pages/locations', $data);
 }
开发者ID:AdaptiveAds,项目名称:AdaptiveAds,代码行数:20,代码来源:LocationController.php

示例13: update

 /**
  * Update the specified resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function update(Request $request)
 {
     $location = Location::all();
     $i = 1;
     foreach ($location as $key => $value) {
         $location1 = 'location1_' . $i;
         $location2 = 'location2_' . $i;
         $getid = 'id_' . $i;
         $id = Input::get($getid);
         $location = Location::find($id);
         $location->location1 = Input::get($location1);
         $location->location2 = Input::get($location2);
         $location->update();
         $i++;
     }
     return redirect('location/management/')->with('message', 'You have done successfully');
 }
开发者ID:rereyossi,项目名称:hairstuation,代码行数:24,代码来源:LocationController.php

示例14: create

 /**
  * Show the form for creating a new resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function create(Request $request)
 {
     $locations = null;
     $tags = null;
     if ($request->session()->get('tags') == null) {
         $tags = Tag::all();
         $request->session()->put('tags', $tags);
     } else {
         $tags = $request->session()->get('tags');
     }
     if ($request->session()->get('locations') == null) {
         $locations = Location::all();
         $request->session()->put('locations', $locations);
     } else {
         $locations = $request->session()->get('locations');
     }
     return view('facebook.campaign.create')->with('locations', $locations)->with('tags', $tags);
 }
开发者ID:QuangBGT,项目名称:kos,代码行数:23,代码来源:FbCampaignController.php

示例15: index

 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index(Request $request)
 {
     $groups = FbGroup::where('tags', 'Undefined')->get();
     $total = count($groups);
     $group = $groups[0];
     $tags = null;
     if ($request->session()->get('tags') == null) {
         $tags = Tag::all();
         $request->session()->put('tags', $tags);
     } else {
         $tags = $request->session()->get('tags');
     }
     $locations = Location::all();
     $options = array();
     foreach ($locations as $location) {
         $options[$location->name] = $location->description;
     }
     return view('facebook.group.index2')->with('options', $options)->with('total', $total)->with('group', $group)->with('tags', $tags);
 }
开发者ID:QuangBGT,项目名称:kos,代码行数:24,代码来源:FbGroupTagsUpdateController.php


注:本文中的app\Location::all方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。