We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
It would be quite nice to include validation rules that could be used in form validations to validate appropriate JSON representations of each class.
For example, we could then validate requests using:
use MatanYadaev\EloquentSpatial\Rules\Point; $request->validate([ 'location' => ['required', new Point], ]);
rather than having to do it manually, such as:
$request->validate([ 'location' => ['required', 'array:type,coordinates'], 'location.type' => ['required', 'in:Point'], 'location.coordinates' => ['required', 'array:0,1'], 'location.coordinates.0' => ['required', 'numeric', 'min:-90', 'max:90'], 'location.coordinates.1' => ['required', 'numeric', 'min:-180', 'max:180'], ]);
Unless I'm being a bit thick and can do it more easily than this?
The text was updated successfully, but these errors were encountered:
Hi @aricooperdavis, sounds cool. Can you submit a PR?
Sorry, something went wrong.
Actually, perhaps this is out of scope for this package, as it's already implemented here: https://github.com/yucadoo/laravel-geojson-rule ?
@aricooperdavis It is kind of out of scope for this package, because it is focused on Eloquent. But I'm open to new ideas. Thanks. :)
No branches or pull requests
It would be quite nice to include validation rules that could be used in form validations to validate appropriate JSON representations of each class.
For example, we could then validate requests using:
rather than having to do it manually, such as:
Unless I'm being a bit thick and can do it more easily than this?
The text was updated successfully, but these errors were encountered: