All Projects → faustbrian → laravel-addressable

faustbrian / laravel-addressable

Licence: MPL-2.0 License
No description or website provided.

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to laravel-addressable

visited-countries
🌎 Countries I Have visited
Stars: ✭ 25 (+108.33%)
Mutual labels:  countries
ngx-ip
An Angular network address component (IPv4, IPv6 and MAC)
Stars: ✭ 20 (+66.67%)
Mutual labels:  address
oracle-geo-data
demo.insum.ca/ords/f?p=131
Stars: ✭ 20 (+66.67%)
Mutual labels:  countries
travel
Visualization of Sourabh's adventures
Stars: ✭ 16 (+33.33%)
Mutual labels:  countries
covid-19
COVID-19 World is yet another Project to build a Dashboard like app to showcase the data related to the COVID-19(Corona Virus).
Stars: ✭ 28 (+133.33%)
Mutual labels:  countries
agegate
A simple function that verifies a date of birth against a country's legal drinking age.
Stars: ✭ 16 (+33.33%)
Mutual labels:  countries
geo-sql-database
Continents, Sub-Continents, Countries, States, Cities, Timezones, Currencies SQL database.
Stars: ✭ 30 (+150%)
Mutual labels:  countries
lieu
Dedupe/batch geocode addresses and venues around the world with libpostal
Stars: ✭ 73 (+508.33%)
Mutual labels:  address
vue-thailand-address
🇹🇭 Thai address input for Vue.
Stars: ✭ 44 (+266.67%)
Mutual labels:  address
test-your-markup
Just a game, made for fun, to test developers HTML5 and JavaScript knowledge, and typing speed!
Stars: ✭ 12 (+0%)
Mutual labels:  countries
rails-countries
Integration between Rails and countries gem.
Stars: ✭ 17 (+41.67%)
Mutual labels:  countries
thaiaddress
A Python Parser for Thai address
Stars: ✭ 33 (+175%)
Mutual labels:  address
tt address
Add address / contact datasets to your content management system.
Stars: ✭ 34 (+183.33%)
Mutual labels:  address
jbanking
A Java banking API
Stars: ✭ 58 (+383.33%)
Mutual labels:  countries
react-vector-maps
🗺 A React component for interactive vector maps of the world and 100+ countries
Stars: ✭ 112 (+833.33%)
Mutual labels:  countries
Btcbf
Bitcoin private key brute force tool, written in python. Also can be used as a bitcoin wallet generator.
Stars: ✭ 91 (+658.33%)
Mutual labels:  address
countriesNowAPI
CountriesNow is an Open source API for retrieving geo-information for countries, including their states, cities, population, etc. 🌎
Stars: ✭ 78 (+550%)
Mutual labels:  countries
custom-permalinks
Set custom permalinks on a per-post basis in WordPress
Stars: ✭ 17 (+41.67%)
Mutual labels:  address
Identity Address DB
(China) 1. MySQL 身份证 地区 数据库(包含已被合并的区县,详见README) 2. PHP 验证身份证号是否正确 3. 从身份证号中获取 性别 生日 年龄 出生地 等信息 4.路过留个star
Stars: ✭ 38 (+216.67%)
Mutual labels:  address
civicstack
A repository for open source civic tools from many countries and organizations
Stars: ✭ 36 (+200%)
Mutual labels:  countries

Laravel Addressable

Build Status PHP from Packagist Latest Version License

Installation

Require this package, with Composer, in the root directory of your project.

$ composer require artisanry/addressable

You can publish the migration with:

$ php artisan vendor:publish --provider="Artisanry\Addressable\AddressableServiceProvider" --tag="migrations"

After the migration has been published you can create the tables by running the migrations:

$ php artisan migrate

You can publish the config file with:

$ php artisan vendor:publish --provider="Artisanry\Addressable\AddressableServiceProvider" --tag="config"

Usage

Setup a Model

<?php

namespace App;

use Artisanry\Addressable\Traits\HasAddresses;
use Illuminate\Database\Eloquent\Model;

class Order extends Model
{
    use HasAddresses;
}

Get an address by role

$user->address('billing');

Set the role of an address

$user->address('billing', Address::find(1));

Create a new address (with a role)

$user->address('shipping', [
    'country_id' => 26,
    'name_prefix' => 'Mrs',
    'first_name' => 'John',
    'last_name' => 'Doe',
    'street' => 'JohnDoe Lane',
    'building_number' => 123,
    'city' => 'New York',
    'state' => 'New York',
    'postcode' => 12345,
]);

Testing

$ phpunit

Security

If you discover a security vulnerability within this package, please send an e-mail to [email protected]. All security vulnerabilities will be promptly addressed.

Credits

This project exists thanks to all the people who contribute.

License

Mozilla Public License Version 2.0 (MPL-2.0).

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].