data_get($data, 'token')], [ 'user_id' => Auth::id(), 'platform' => data_get($data, 'platform'), 'app_type' => data_get($data, 'app_type'), 'active' => true, ] ); } public function remove(string $token): void { DeviceToken::where('token', $token) ->where('user_id', Auth::id()) ->update(['active' => false]); } }