Download the PHP package adamcmoore/laravel-location-validator without Composer
On this page you can find all versions of the php package adamcmoore/laravel-location-validator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download adamcmoore/laravel-location-validator
More information about adamcmoore/laravel-location-validator
Files in adamcmoore/laravel-location-validator
Download adamcmoore/laravel-location-validator
More information about adamcmoore/laravel-location-validator
Files in adamcmoore/laravel-location-validator
Vendor adamcmoore
Package laravel-location-validator
Short Description A Laravel validation rule to check that a lng/lat pair are within an area.
License MIT
Package laravel-location-validator
Short Description A Laravel validation rule to check that a lng/lat pair are within an area.
License MIT
Please rate this library. Is it a good library?
Informations about the package laravel-location-validator
Laravel Location Validator
A Laravel validation rule to check that a lng/lat pair are within an area.
Installation
Usage
use AcMoore\LocationValidator\LocationValidator;
// Validate that latitude & longitude is inside an area
$allowed_area = [
[48.9675969, 1.7440796],
[48.4711003, 2.5268555],
[48.9279131, 3.1448364],
[49.3895245, 2.6119995],
];
$request->validate(
[
'latitude' => 'latitude',
'longitude' => 'longitude',
],
[
'latitude' => new LocationValidator(
$request->get('longitude'), // Longitude needs to be supplied as an argument when using a Rule Object
$allowed_area
)
]
);
### Todo
- [ ] Add support for latitude & lognitude in same field, like spatial fields or comma seperated.
- [ ] Allow multiple areas.
- [ ] Add validation rule to `Validator::extend` in a service provider.
All versions of laravel-location-validator with dependencies
PHP Build Version
Package Version
Requires
php Version
^8.1
illuminate/console Version ^10
illuminate/database Version ^10
illuminate/filesystem Version ^10
league/geotools Version ^1.1
illuminate/console Version ^10
illuminate/database Version ^10
illuminate/filesystem Version ^10
league/geotools Version ^1.1
The package adamcmoore/laravel-location-validator contains the following files
Loading the files please wait ....