It's convenient to change the user's API Token when its password changes.
Model:
1public function setPasswordAttribute($value)2{3 $this->attributes['password'] = $value;4 $this->attributes['api_token'] = Str::random(100);5}
It's convenient to change the user's API Token when its password changes.
Model:
1public function setPasswordAttribute($value)2{3 $this->attributes['password'] = $value;4 $this->attributes['api_token'] = Str::random(100);5}