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


PHP app\Address类代码示例

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


在下文中一共展示了Address类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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' => 'excursion@gmail.com']);
     foreach ($seederData as $item) {
         Address::create($item);
     }
 }
开发者ID:shotaK,项目名称:ExcursionApp,代码行数:14,代码来源:AddressTableSeeder.php


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