Download the PHP package rahasistiyak/laravel-geo-data without Composer
On this page you can find all versions of the php package rahasistiyak/laravel-geo-data. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download rahasistiyak/laravel-geo-data
More information about rahasistiyak/laravel-geo-data
Files in rahasistiyak/laravel-geo-data
Package laravel-geo-data
Short Description A Laravel package providing optimized access to region, country, phone code, city, and currency data
License MIT
Homepage https://github.com/rahasistiyakofficial/laravel-geo-data
Informations about the package laravel-geo-data
Laravel Geo Data
An optimized Laravel package for accessing region, country, phone code, city, and currency data.
Compatibility
- PHP: 7.3+, 8.0+
- Laravel: 6.x, 7.x, 8.x, 9.x, 10.x, 11.x, 12.x
Installation
To install the package, run the following command:
`
The package will be auto-discovered by Laravel.
Publish the Configuration File (if needed)
If you'd like to publish the configuration file for customization, use:
This will publish the configuration file to config/geo-data.php
.
Usage
Regions
You can interact with the regions model as follows:
Countries
You can interact with the countries model as follows:
Phone Codes
You can interact with the phone codes model as follows:
Cities
You can interact with the cities model as follows:
Currencies
You can interact with the currencies model as follows:
Configuration
You can edit the configuration in config/geo-data.php
. The configuration file includes options for enabling/disabling specific data types and setting cache duration.
Test Usage
To test the functionality, you can add the following route in your routes/web.php
file:
This will give you a sample response for countries and cities data.
Why This is Optimized
- Memory Efficiency: Caching with
Cache::remember
reduces file I/O and memory usage for repeated calls. - Code Reusability: The
BaseGeoModel
class eliminates duplicate logic across models. - Large Dataset Handling: The
paginate
method allows partial loading of large datasets, like cities, to avoid memory overflow. - Error Handling: The package validates data files and logs warnings for any missing or corrupted files.
- Flexibility: Dropdown fields and sorting are customizable to suit different use cases.
- Performance: Configuration checks are done once during data loading, and cache TTL is configurable for optimized performance.
License
This package is open-source and available under the MIT License.
Contact
For any questions or support, you can reach us at: Email: [email protected]
All versions of laravel-geo-data with dependencies
illuminate/support Version ^7.0|^8.0|^9.0|^10.0|^11.0|^12.0
illuminate/cache Version ^7.0|^8.0|^9.0|^10.0|^11.0|^12.0