sfneal / address
Add polymorphic 'address' relationships to Eloquent Models in Laravel applications
Installs: 59 649
Dependents: 6
Suggesters: 1
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 2
Requires
- php: ^8.0
- sfneal/array-helpers: ^3.0
- sfneal/models: ^3.0|^4.0
- sfneal/string-helpers: ^1.0
Requires (Dev)
- orchestra/testbench: ^7.40|^8.0|9.0
- phpunit/phpunit: ^9.6|^10.0|^11.0
- sfneal/datum: ^2.0
- sfneal/mock-models: >=0.8
README
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 stephen.neal14@gmail.com 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.