Support the ongoing development of →
Authentication Session
Last updated 1 year ago.

I would store the user's IP to the DB when he logs-in. Then I would create new middleware, something like "logoutOnIPChange" and register this middleware to Kernel "$middleware" property.

The middleware handle method can look like this

if (Auth::user()->ip != Request::ip())

PS: remember to use Auth and Request facades in the logoutOnIPChange middleware file.

PS2: maybe registering it to kernel is not good idea. You should create a route middleware and assign this middleware to your desired routes (see

Last updated 7 years ago.

Thanks! I solved this.


Sign in to participate in this thread!


Your banner here too?


We'd like to thank these amazing companies for supporting us

Your logo here?

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 - All rights reserved.