本文整理汇总了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);
}
示例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);
}
}
}
示例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;');
}
示例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);
});
//
}
示例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'));
}
示例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();
}
示例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]);
}
示例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;
}
示例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')]);
}
}
示例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']));
}
示例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]);
}
}
示例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);
}
示例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);
}
示例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!!!!!!!!!!!!']);
}
示例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);
}
}