• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP app\Address类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中app\Address的典型用法代码示例。如果您正苦于以下问题:PHP Address类的具体用法?PHP Address怎么用?PHP Address使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



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

示例1: addAddress

 public function addAddress($address_line_1, $address_line_2, $address_city, $address_postcode)
 {
     $address = new Address();
     $address->line_1 = $address_line_1;
     $address->line_2 = $address_line_2;
     $address->city = $address_city;
     $address->postcode = $address_postcode;
     $address->save();
     $this->addresses()->save($address);
 }
开发者ID:VoodooPrawn,项目名称:finest,代码行数:10,代码来源:Branch.php


示例2: __construct

 public function __construct(\App\Address $address)
 {
     $this->addressId = $address->id;
     $this->regionId = $address->region->id;
     $this->name = $address->region->name . " " . $address->name;
     if ($address->stars()->count() > 0) {
         foreach ($address->stars()->get() as $star) {
             $this->centers[] = new centerStar($star->id);
         }
     }
     if ($address->centers()->count() > 0) {
         foreach ($address->centers()->get() as $center) {
             $this->centers[] = new centerMulti($center->id);
         }
     }
 }
开发者ID:Qeenslet,项目名称:elite-lara,代码行数:16,代码来源:Insider.php


示例3: run

 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     //Truncate
     DB::statement('SET FOREIGN_KEY_CHECKS=0;');
     User::truncate();
     Admin::truncate();
     Customer::truncate();
     Address::truncate();
     Category::truncate();
     Product::truncate();
     Brand::truncate();
     Type::truncate();
     Image::truncate();
     DB::statement('TRUNCATE category_product;');
     Product::clearIndices();
     Product::reindex();
     //Unguard
     Model::unguard();
     //Call
     $this->call(UsersTableSeeder::class);
     $this->call(ProductsTableSeeder::class);
     //Reguard
     Model::reguard();
     DB::statement('SET FOREIGN_KEY_CHECKS=1;');
 }
开发者ID:jentleyow,项目名称:megadeal,代码行数:30,代码来源:DatabaseSeeder.php


示例4: boot

 /**
  * Define your route model bindings, pattern filters, etc.
  *
  * @param  \Illuminate\Routing\Router  $router
  * @return void
  */
 public function boot(Router $router)
 {
     parent::boot($router);
     $router->bind('client', function ($value, $route) {
         $hashids = new Hashids('MySecretSalt*(&^%$eo&*^%&r', 20);
         $id = $hashids->decode($value)[0];
         return Client::findOrFail($id);
     });
     $router->bind('bank', function ($value, $route) {
         $hashids = new Hashids('MySecretSalt*(&^%$eo&*^%&r', 20);
         $id = $hashids->decode($value)[0];
         return BankDetail::findOrFail($id);
     });
     $router->bind('address', function ($value, $route) {
         $hashids = new Hashids('MySecretSalt*(&^%$eo&*^%&r', 20);
         $id = $hashids->decode($value)[0];
         return Address::findOrFail($id);
     });
     $router->bind('property', function ($value, $route) {
         $hashids = new Hashids('MySecretSalt*(&^%$eo&*^%&r', 20);
         $id = $hashids->decode($value)[0];
         return Property::findOrFail($id);
     });
     $router->bind('agreement', function ($value, $route) {
         $hashids = new Hashids('MySecretSalt*(&^%$eo&*^%&r', 20);
         $id = $hashids->decode($value)[0];
         return RentalAgreement::findOrFail($id);
     });
     //
 }
开发者ID:arianpour,项目名称:AgentProV0.6,代码行数:36,代码来源:RouteServiceProvider.php


示例5: show

 /**
  * Display the specified resource.
  *
  * @param RentalAgreement $agreement
  * @return Response
  * @internal param int $id
  */
 public function show(RentalAgreement $agreement)
 {
     $address = Address::find($agreement->property_id);
     $client = Client::find($agreement->client_id);
     $owner = Client::find($agreement->owner_id);
     return view('agreement.showAgreement', compact('agreement', 'address', 'client', 'owner'));
 }
开发者ID:arianpour,项目名称:AgentProV0.6,代码行数:14,代码来源:RentalAgreementController.php


示例6: findAddresses

 protected function findAddresses()
 {
     $this->newAddr = \App\Address::find($this->newId);
     $this->oldAddr = \App\Address::find($this->oldId);
     $this->result['addresses'] = 'found';
     $this->checkStars();
 }
开发者ID:Qeenslet,项目名称:elite-lara,代码行数:7,代码来源:Uniter.php


示例7: getOffer

 public function getOffer(Request $request, $shop_id = 0, $offer_id = 0)
 {
     $business = Business::apiFind($shop_id);
     $offer = Offer::apiFind($shop_id, $offer_id);
     $address = Address::apiLast();
     session(['uri' => URL::full()]);
     return view('auth.business.offer', ['TITLE' => '商家项目', 'META_KEYWORDS' => META_KEYWORDS, 'META_DESC' => META_DESC, 'PAGE_CODE' => 'auth.business.offer', 'business' => $business, 'offer' => $offer, 'address' => $address]);
 }
开发者ID:verchielxy,项目名称:ttx,代码行数:8,代码来源:BusinessController.php


示例8: create

 /**
  * Create a new user instance after a valid registration.
  *
  * @param  array  $data
  * @return User
  */
 protected function create(array $data)
 {
     $users = User::create(['name' => $data['name'], 'email' => $data['email'], 'password' => bcrypt($data['password']), 'school_id' => $data['school_id']]);
     $users->schools()->attach($data['school_id']);
     $address = Address::create(['contact11' => $data['contact11']]);
     $users->addresses()->save($address);
     return $users;
 }
开发者ID:Khande1n,项目名称:ujval,代码行数:14,代码来源:AuthController.php


示例9: run

 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $faker = Faker::create();
     $amount = 5;
     for ($i = 0; $i < $amount; $i++) {
         Address::create(['address' => $faker->streetAddress, 'user_id' => $i + 1, 'created_at' => $faker->date('Y-m-d H:i:s'), 'updated_at' => $faker->date('Y-m-d H:i:s')]);
     }
 }
开发者ID:shirkkan,项目名称:shop-core,代码行数:13,代码来源:AddressSeeder.php


示例10: meta

 /**
  * @return $this
  */
 public function meta()
 {
     $img_url = 'http://d14d0ey1pb5ifb.cloudfront.net/';
     $property = \App\Property::where(['meta_set' => 0, 'status' => '1'])->orderBy('package', 'DESC')->first();
     $address = \App\Address::where(['property_id' => $property->property_id])->first();
     $images = \App\Image::where(['property_id' => $property->property_id])->orderBy('pos', 'ASC')->get();
     return view('dashboard.meta')->with(compact(['property', 'address', 'images', 'img_url']));
 }
开发者ID:brevig907,项目名称:apt,代码行数:11,代码来源:DashboardController.php


示例11: run

 public function run()
 {
     $types = AddressType::$types;
     $keys = array_keys($types);
     $faker = Factory::create();
     foreach (range(0, 30) as $index) {
         Address::create(['type' => $faker->randomElement($keys), 'street' => $faker->streetName, 'city' => $faker->city, 'country' => $faker->country, 'zip' => $faker->countryCode]);
     }
 }
开发者ID:Tisho84,项目名称:laravel-work,代码行数:9,代码来源:AddressesTableSeeder.php


示例12: addLocation

 public function addLocation(Request $request)
 {
     $addressData = $this->formAddress($request);
     $addressData['shop_id'] = $request->get('shop_id');
     $addressData['open_from'] = $request->get('open_from');
     $addressData['open_to'] = $request->get('open_to');
     $locId = Address::addLocation($addressData);
     return Response::json($locId);
 }
开发者ID:leloulight,项目名称:fashionmonkee,代码行数:9,代码来源:ShopController.php


示例13: retrieveOrCreate

 /**
  * attempts to find a matching address before creating a new instance
  */
 public static function retrieveOrCreate(array $attributes = [])
 {
     // TODO: look up address attributes to find a match
     $existing_addr = Address::where('street', $attributes['street'])->where('city', $attributes['city'])->where('state', $attributes['state'])->where('zip1', $attributes['zip1'])->first();
     if ($existing_addr) {
         return $existing_addr;
     }
     return Address::create($attributes);
 }
开发者ID:kevjava,项目名称:Safe-Assist,代码行数:12,代码来源:Address.php


示例14: run

 public function run()
 {
     Address::truncate();
     Address::create(['user_id' => '1', 'address1' => 'T Nagar', 'address2' => 'New York', 'city' => 'Melbourne', 'state' => 'Dubai', 'country' => 'USA', 'pin' => '4213456', 'phone' => '7234556', 'landmark' => 'Lifes easy']);
     Address::create(['user_id' => '2', 'address1' => 'Anna Nagar', 'address2' => 'Yorkshire', 'city' => 'canberra', 'state' => 'Chennai', 'country' => 'UFA', 'pin' => '43433', 'phone' => '533336', 'landmark' => 'world easy']);
     Address::create(['user_id' => '3', 'address1' => 'Srinagar', 'address2' => 'New Jersey', 'city' => 'Stockholm', 'state' => 'Dublin', 'country' => 'SA', 'pin' => '13456', 'phone' => '4556', 'landmark' => 'Lifes Tough']);
     Address::create(['user_id' => '4', 'address1' => 'Tilak Nagar', 'address2' => 'New Delhi', 'city' => 'Qatar', 'state' => 'New Castle', 'country' => 'Canada', 'pin' => '456', 'phone' => '756', 'landmark' => 'Too easy']);
     Address::create(['user_id' => '5', 'address1' => 'Nagar', 'address2' => 'York', 'city' => 'bourne', 'state' => 'Duai', 'country' => 'SAE', 'pin' => '42456', 'phone' => '756', 'landmark' => 'Lifes!!!!!!!!!!!!']);
 }
开发者ID:surajch,项目名称:ensue-me,代码行数:9,代码来源:AddressTableSeeder.php


示例15: run

 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     // We want to delete the table if it exists before running the seed
     DB::table('address')->delete();
     $seederData = array(['text' => 'We offer you awesome tours', 'address' => 'Moonshine St. 14/05 Light, Jupiter', 'phone' => '+00 (123) 456 78 90', 'mail' => '[email protected]']);
     foreach ($seederData as $item) {
         Address::create($item);
     }
 }
开发者ID:shotaK,项目名称:ExcursionApp,代码行数:14,代码来源:AddressTableSeeder.php


示例16: run

 public function run()
 {
     $faker = Faker::create();
     //Category
     for ($i = 0; $i < 10; $i++) {
         $user = User::select(['id'])->where('id', rand(1, User::count()))->first();
         $address = Address::create(['user_id' => $i <= 2 ? 4 : $user->id, 'default' => 0, 'line1' => $faker->streetAddress, 'line2' => $faker->streetAddress, 'phone' => $faker->e164PhoneNumber, 'name_contact' => $faker->streetName, 'zipcode' => $faker->postcode, 'city' => $faker->city, 'country' => $faker->country, 'state' => $faker->state]);
     }
 }
开发者ID:ant-vel,项目名称:antVel,代码行数:9,代码来源:AddressesTableSeeder.php


示例17: handle

 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Closure  $next
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     $addressId = $request->segments()[2];
     $addrUser = Address::find($addressId);
     // if ($addrUser->user_id != Auth::user()->id)
     // {
     //     return redirect('profile')->with('danger', 'This address is not associated with you.');
     // }
     return $next($request);
 }
开发者ID:samyerkes,项目名称:sweet.com,代码行数:17,代码来源:AddressUser.php


示例18: getIndex

 public function getIndex(Request $request)
 {
     $address = \App\Address::where('user_id', '=', \Auth::id())->get()->first();
     if (is_null($address)) {
         \Session::flash('flash_message', 'Please create an address for your account');
         return redirect('addresses/create');
     }
     $accounts = \App\Account::where('user_id', '=', \Auth::id())->orderBy('id', 'ASC')->get();
     return view('account.index')->with('accounts', $accounts);
 }
开发者ID:trietvu,项目名称:p4,代码行数:10,代码来源:AccountController.php


示例19: updateAddress

 public static function updateAddress($address)
 {
     try {
         $addressObj = Address::findOrFail($address['id']);
         $data = $addressObj->update(['lat' => $address['lat'], 'long' => $address['long']]);
     } catch (Exception $e) {
         $data = ['error' => 'Address not updated', 'message' => $e->getMessage()];
     }
     return $data;
     // dd(['$address' => $address, 'updated' => $data, 'addressObj' => $addressObj->toArray()]); exit;
 }
开发者ID:pierrestudios,项目名称:territory-api,代码行数:11,代码来源:Coordinates.php


示例20: validateAndSaveConsumer

 private function validateAndSaveConsumer(Request $request, Consumer $consumer)
 {
     $this->validate($request, array_merge(['first_name' => 'required', 'last_name' => 'required', 'description' => 'required'], Address::rules()));
     // TODO: check to see if logged in user is a caregiver for this consumer
     $consumer->first_name = $request->first_name;
     $consumer->last_name = $request->last_name;
     $consumer->description = $request->description;
     $consumer->address_id = Address::retrieveOrCreate(['street' => $request->street, 'city' => $request->city, 'state' => $request->state, 'zip1' => $request->zip1])->id;
     $consumer->save();
     return Redirect::to('/caregiver');
 }
开发者ID:kevjava,项目名称:Safe-Assist,代码行数:11,代码来源:ConsumerController.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP app\App类代码示例发布时间:2022-05-23
下一篇:
PHP app\Activity类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap