By selecting only 'active' you make it impossible to perform update. Eloquent doesn't know the key then.
So select id (or whatever PK columns is) too and it will work:
$user=User::where('token',$token)->select('id', 'active')->first();
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community