cloudcreativity / laravel-json-api

JSON API (jsonapi.org) package for Laravel applications.
http://laravel-json-api.readthedocs.io/en/latest/
Apache License 2.0
780 stars 109 forks source link

Validator partial implementation #477

Closed ankr closed 4 years ago

ankr commented 4 years ago

Hello, Thanks for the hard work on this package! Though I've encountered a little thing that I hoped you could help me clarify.

The Validator class seems to be not much but a proxy to an actual Laravel Validator class. However only a small subset of the methods from the Laravel implementation has been mapped in this proxy.

Is there/what are the reasoning behind this - and would you be open for PRs to map more of the methods?

lindyhopchris commented 4 years ago

Hello! No problem, glad you like the package!

Yeah, it's sort of a proxy to the actual Laravel Validator class. I'm going to make this better in v2 when I get the time to work on that.

In the meantime, the reason for the subset of methods implemented is I just followed the interface. My programming style is to stick to interfaces, so if Laravel haven't defined some of the methods on their interface, that's why they're not in there.

If you want any other methods, I'm happy for them to be added - but you'd need to submit PRs for the methods you want added as this won't be a priority for me. (When I next get time to work on this package - hopefully soon - I'll be working on v2.)

ankr commented 4 years ago

That makes good sense. I'll try find some time to get around implementing more of the methods. I'll try investigate why there are not more of them on the interface.

Thank you!