/** * {@inheritdoc} */ public function setAttribute($key, $value) { if ($key === 'value' && $value === self::PRIVATE_MASK && $this->exists) { $value = $this->value; } parent::setAttribute($key, $value); }
public static function boot() { parent::boot(); static::saved(function (Config $config) { if (Cache::has('system_config')) { Cache::forget('system_config'); } }); }
/** * {@inheritdoc} */ public static function boot() { parent::boot(); static::creating(function (CorsConfig $config) { $config->validateAndClean(); return true; }); static::updating(function (CorsConfig $config) { $config->validateAndClean(); return true; }); }
public static function boot() { parent::boot(); static::saved(function (Role $role) { if (!$role->is_active) { JWTUtilities::invalidateTokenByRoleId($role->id); } \Cache::forget('role:' . $role->id); }); static::deleted(function (Role $role) { JWTUtilities::invalidateTokenByRoleId($role->id); \Cache::forget('role:' . $role->id); }); }
public static function boot() { parent::boot(); static::saving(function (RoleServiceAccess $rsa) { if (1 === $rsa->service_id && ('*' === $rsa->component || 'admin' === $rsa->component)) { throw new BadRequestException('* and/or admin is not allowed on system service.'); } }); static::saved(function (RoleServiceAccess $rsa) { \Cache::forget('role:' . $rsa->role_id); }); static::deleted(function (RoleServiceAccess $rsa) { \Cache::forget('role:' . $rsa->role_id); }); }
public static function boot() { parent::boot(); static::created(function (Service $service) { if (!empty($service->config)) { // take the type information and get the config_handler class // set the config giving the service id and new config $serviceCfg = $service->getConfigHandler(); if (!empty($serviceCfg)) { return $serviceCfg::setConfig($service->getKey(), $service->config); } } return true; }); static::saved(function (Service $service) { \Cache::forget('service:' . $service->name); \Cache::forget('service_id:' . $service->id); // Any changes to services needs to produce a new event list Event::clearCache(); Swagger::clearCache($service->name); }); static::deleting(function (Service $service) { // take the type information and get the config_handler class // set the config giving the service id and new config $serviceCfg = $service->getConfigHandler(); if (!empty($serviceCfg)) { return $serviceCfg::removeConfig($service->getKey()); } return true; }); static::deleted(function (Service $service) { \Cache::forget('service:' . $service->name); \Cache::forget('service_id:' . $service->id); // Any changes to services needs to produce a new event list Event::clearCache(); Swagger::clearCache($service->name); }); }
public static function boot() { parent::boot(); static::saved(function (User $user) { if (!$user->is_active) { JWTUtilities::invalidateTokenByUserId($user->id); } \Cache::forget('user:'******'user:' . $user->id); }); }