PHP code example of laravel-enso / addresses

1. Go to this page and download the library: Download laravel-enso/addresses library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

laravel-enso / addresses example snippets


use Illuminate\Database\Eloquent\Model;
use LaravelEnso\Addresses\Traits\Addressable;

class Company extends Model
{
    use Addressable;
}

$company->address;
$company->billingAddress;
$company->shippingAddresses;
$company->addresses;

$company->addresses()->create([
    'country_id' => 1,
    'region_id' => 10,
    'locality_id' => 25,
    'street' => 'Main Street',
    'number' => '10',
    'postcode' => '123456',
    'is_default' => true,
]);
bash
php artisan migrate