LaraCrafts / laravel-geo-routes

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

Add GeoGroups #34

Closed yak0d3 closed 4 years ago

yak0d3 commented 4 years ago

This pull request solves #10 therefore adding support for route groups.

Additions

  1. The GeoGroup class: This class is responsible of defining the route group and applying the geo-constraint on it.
  2. The geo macro method: This is a Router macro method used to define the GeoGroup.
  3. The ControlsAccess trait: Resolves duplicate code, contains the access methods (allow, deny, allowFrom and denyFrom).
  4. The HasCallback trait: Resolves duplicate code, contains the callback-related methods (loadProxies, setCallback and the default callbacks)

Potential Changes

I am concerned about the ControlsAccess and HasCallback traits defining the callback, proxies, strategy and countries properties, i think this might have to be changed to calling methods such as getCallbackProperty as seen in many Laravel traits, so would you please share your opinion concerning this topic?