What seems to be the problem:
Hi I have build a application where a account should be logged in only once (so not working from multiple browsers). I have created a session_hash attribute at the User model which gets refreshed when logged in and registered in the session. When another browser triggers the login the session_hash changes. In traditional laravel it is quite easy to build a middleware to check if the in_session session_hash is the same as the one in the database and then call redirect and exit; But how does one accomplish this is Livewire. Is Middleware the right tool for this or should it be part of a trait on the component.
When in middleware I cannot redirect, cannot trigger a browserEvent…
When I build a trait I have access but I need a hook to check for instance the updating event? But do I catch all use cases this way?
I would rather have this implemented as middleware then as a trait?
Could you please advise?
Are you using the latest version of Livewire:
Yes