LaraCrafts / laravel-geo-routes

GeoLocation restricted routes for Laravel
MIT License
111 stars 5 forks source link

Add a callbacks registrar #36

Closed yak0d3 closed 5 years ago

yak0d3 commented 5 years ago

This pull request adds a callbacks registrar under the name CallbacksRegistrar which is a class responsible for registering and retrieving callbacks, it also offers some convenience methods such as the hasCallback and the hasProxy methods.

Thanks to this registrar, our GeoRoute class now has a single responsibility which is setting the geo rule.

The registrar will as well allow us to easily implement the default callback mechanism, i actually have wrote a draft code then deleted it deciding it would be better to add it in the next pull request not to make this a huge one.