PHP code example of enflow / laravel-address

1. Go to this page and download the library: Download enflow/laravel-address 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/ */

    

enflow / laravel-address example snippets


Schema::table('companies', function (Blueprint $table) {
    // ...
    $table->foreignId('address_id')->constrained();
});



use Enflow\Address\Models\Address;
use Illuminate\Database\Eloquent\Model;

class Company extends Model
{
    public function address()
    {
        return $this->belongsTo(Address::class);
    }
}
 bash
php artisan vendor:publish --provider="Enflow\Address\AddressServiceProvider" --tag="config"
 bash
php artisan vendor:publish --provider="Enflow\Address\AddressServiceProvider" --tag="migrations"