andreaselia / laravel-analytics

Analytics for the Laravel framework.
MIT License
165 stars 25 forks source link

Allow wildcard in exclude routes #30

Closed Umfi closed 2 years ago

Umfi commented 2 years ago

This change allows wildcards in the exclude routes. So it is not required anymore to add each single route. Instead we can write it like this.

'exclude' => [ '/analytics', '/admin', '/admin/*', ],

The code is based on the VerifyCsrfToken middleware, which can be found here: https://github.com/laravel/framework/blob/9.x/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php

andreaselia commented 2 years ago

Thanks for your contribution @Umfi ❤️ I'll take a look at this when I can 😁

Cc: @tomirons

andreaselia commented 2 years ago

Looks good to me, thanks again @Umfi 👍