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())
{
Auth::logout()
}
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 https://laravel.com/docs/5.4/middleware#assigning-middleware-to-routes)
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community