Except is not working correctly
danielreales7 opened this issue · 12 comments
I think it's because of redirection.
please check the below file (middleware)
https://github.com/shetabit/visitor/blob/master/src/Middlewares/LogVisits.php
please check the below file (middleware)
https://github.com/shetabit/visitor/blob/master/src/Middlewares/LogVisits.php
I think so... but I can't modify this file. I published the file but I have this error:
How can I fix the redirect? Thank you so much!
remove LogVisits middleware from your middlewares. create a new middleware and use it instead.
you can see middleware in the below link
https://github.com/shetabit/visitor/blob/master/src/Middlewares/LogVisits.php
and we don't have any auto-registering middleware in our provider. I think this is because of Laravel's route cache.
the provider is in the below path
https://github.com/shetabit/visitor/blob/master/src/Provider/VisitorServiceProvider.php
you can see middleware in the below link
https://github.com/shetabit/visitor/blob/master/src/Middlewares/LogVisits.php
and we don't have any auto-registering middleware in our provider. I think this is because of Laravel's route cache.
the provider is in the below path
https://github.com/shetabit/visitor/blob/master/src/Provider/VisitorServiceProvider.php
Ohhhh! I understand what is happening. In the /admin route I show the unique visits:
{{ visitor()->visit()->distinct('ip')->count('ip') }}
This shouldn't create a registry for me, right? I only want to show the unique visits.
Sorry for being so heavy.
you can see middleware in the below link
https://github.com/shetabit/visitor/blob/master/src/Middlewares/LogVisits.php
and we don't have any auto-registering middleware in our provider. I think this is because of Laravel's route cache.
the provider is in the below path
https://github.com/shetabit/visitor/blob/master/src/Provider/VisitorServiceProvider.php
It's works correctly:
I think this should be the ideal operation because I would not like to log a visit to count unique visits.
Thank you so much for your help!
I think its better to use $this->request->is($yourPattern)
https://laravel.com/docs/8.x/requests#inspecting-the-request-path
I think its better to use
$this->request->is($yourPattern)
https://laravel.com/docs/8.x/requests#inspecting-the-request-path
You're right, it was by following the configuration logic.