address

Add polymorphic 'address' relationships to Eloquent Models in Laravel applications

MIT License

Downloads
59K
Stars
0
Committers
1

Address

Add polymorphic 'address' relationships to Eloquent Models in Laravel applications.

Installation

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"

Usage

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');
}

Testing

composer test

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

PHP Package Boilerplate

This package was generated using the PHP Package Boilerplate.

Package Rankings
Top 15.82% on Packagist.org
Badges
Extracted from project README
Packagist PHP support Latest Version on Packagist Scrutinizer Code Quality Total Downloads