Add polymorphic 'address' relationships to Eloquent Models in Laravel applications
MIT License
Add polymorphic 'address' relationships to Eloquent Models in Laravel applications.
You can install the package via composer:
composer require sfneal/address
To make use of database migration, publish the Service Provider.
php artisan vendor:publish --provider="Sfneal\Address\Providers\AddressServiceProvider"
Add a 'address' relationship to an Eloquent Model.
use Illuminate\Database\Eloquent\Relations\MorphOne;
use Sfneal\Address\Models\Address;
/**
* Address relationship.
*
* @return MorphOne|Address
*/
public function address()
{
return $this->morphOne(Address::class, 'addressable');
}
composer test
Please see CHANGELOG for more information what has changed recently.
Please see CONTRIBUTING for details.
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.
This package was generated using the PHP Package Boilerplate.