Laravel Geographical

screenshot of Laravel Geographical

Easily add longitude and latitude columns to your records and use inherited functionality for calculating distances

Overview

Laravel Geographical is a powerful package designed to enhance your Laravel application by easily adding geographical capabilities to your data models. It allows developers to incorporate longitude and latitude coordinates seamlessly, enabling functionalities such as distance calculations and geofencing. This tool is particularly useful for applications that need to handle location-based data efficiently, making it a valuable addition for developers looking to improve their geographic data management.

With Laravel Geographical, implementing features like distance checks between users or finding entries within a specific radius becomes straightforward. The package is designed to integrate smoothly with Laravel's Eloquent ORM, making it a natural fit for existing projects that already utilize this framework. Whether you're building a location-based service or simply need to manage geo-data better, this package offers an intuitive solution to meet your requirements.

Features

  • Distance Calculation: Easily calculate the distance to all entries in your table from a specific location, enhancing user experience with location-aware features.
  • Geofencing: Find all entries within a circular geo-fence by simply defining inner and outer radius values, making location filtering effortless.
  • Customizable Units: Default distance units are in miles, but you can easily switch to kilometers by adjusting your model settings.
  • Eloquent Integration: Returns an Eloquent\Builder object for flexibility in adding optional conditions, making it easy to adapt query results.
  • Aggregation Support: Utilize distance as an aggregate column in your queries, allowing advanced data processing while adhering to Eloquent conventions.
  • Dynamic Options: Pass an array of options at runtime to set new table or column names, accommodating complex data structures or joined tables.
  • Compatibility: Requires PHP 5.6.4+ and Laravel 5+, ensuring it can be integrated into a wide range of existing Laravel applications.
  • Simple Installation: Easily installable via Composer, allowing for quick setup and incorporation into any Laravel project.