'datetime', ]; /** * Perform any actions required after the model boots. * * @return void */ protected static function booted() { // * EVENT CLOSURES. static::creating(function (self $model) { if (Hash::needsRehash($model->password)) { $model->password = Hash::make($model->password); } $model->remember_token = Str::random(10); }); static::updating(function (self $model) { if (Hash::needsRehash($model->password)) { $model->password = Hash::make($model->password); } $model->remember_token = Str::random(10); }); } }