Download the PHP package masterix21/laravel-addressable without Composer
On this page you can find all versions of the php package masterix21/laravel-addressable. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download masterix21/laravel-addressable
More information about masterix21/laravel-addressable
Files in masterix21/laravel-addressable
Package laravel-addressable
Short Description Addresses for any Eloquent model
License MIT
Homepage https://github.com/masterix21/laravel-addressable
Informations about the package laravel-addressable
Addresses for any Eloquent model
This package adds to any Eloquent model the addresses: in this way will be easier to support a billing address, the shipment addresses or others.
It uses the great package matanyadaev/laravel-eloquent-spatial
by Matan Yadaev.
Support us
If you like my work, you can sponsoring me.
Installation
You can install the package via composer:
You can publish and run the migrations with:
You can publish the config file with:
Usage
Extends an Eloquent model to supports the addresses is simple.
HasAddress
is a generic trait that will implements all addresses code, but if you like to handle the shipments addresses or the billing address there are other two traits.
Mark and unmark an address as primary
To be sure that only one address per type will be "primary", you can use the markPrimary()
method. It will mark the address as primary and will unmark the others (of the same type).
Create a billing address with coordinates
Store latitude and longitude for an address
Query addresses by their distance from/to another point
Testing
Todo
- [ ] Method to retrieve all nearby addresses of X kilometers
Changelog
Please see CHANGELOG for more information on 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
- Luca Longo
- Matan Yadaev
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
All versions of laravel-addressable with dependencies
illuminate/contracts Version ^11.23
matanyadaev/laravel-eloquent-spatial Version ^4.4