-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
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
Support Geometry class extension #125
Support Geometry class extension #125
Conversation
@jobverplanke Thanks for pushing this PR! |
Thank you for merging! |
@jobverplanke I'm really thankful for your PR I have been search for a solution to override |
@Mohammed-Alama Can you try to explain what's your use case? Why did you try to extend the functionality? Maybe I'll figure out a different way to do so. |
@MatanYadaev I was trying to use firstly try to override Geometry class with $this->app->bind(Geometry::class,GeometryExtension::class) then try to override |
Did you try the approach mentioned here? https://github.com/MatanYadaev/laravel-eloquent-spatial?tab=readme-ov-file#extend-with-custom-geometry-classes |
@MatanYadaev that exactly the issue that you did not use Laravel's container in the package |
I have been through an issue related to use different name from classes form the package https://github.com/phayes/geoPHP/blob/685562416ec6d22b9b3927e02ca0ddacf84ca646/lib/adapters/GeoJSON.class.php#L47 |
This PR adds support for custom geometry classes by extending the current geometry classes.
I was looking for a way to modify some of the array data returned by
Point::toArray()
method and was unable to do so.After searching through recent PR's and issues I stumbled upon #63 which actually adds this functionality, but it was closed because the solution was "too complicated and not elegant".
Although this PR does not really differs from the one you already made (#63) I think people can benefit from this functionality, thats why I would like to give it another try.
The only real difference between #63 and this PR is the way of using the custom geometry classes by making it look more "Laravel-ish", for example looking at Laravel Jetstream how it uses custom User, Team, Membership and TeamInvitation models. (https://github.com/laravel/jetstream/blob/5.x/src/Jetstream.php#L282)
Thank you for creating this package!