Changeset View
Changeset View
Standalone View
Standalone View
src/app/Observers/ResourceSettingObserver.php
Show All 11 Lines | class ResourceSettingObserver | ||||
* | * | ||||
* @param \App\ResourceSetting $resourceSetting Settings object | * @param \App\ResourceSetting $resourceSetting Settings object | ||||
* | * | ||||
* @return void | * @return void | ||||
*/ | */ | ||||
public function created(ResourceSetting $resourceSetting) | public function created(ResourceSetting $resourceSetting) | ||||
{ | { | ||||
if (in_array($resourceSetting->key, LDAP::RESOURCE_SETTINGS)) { | if (in_array($resourceSetting->key, LDAP::RESOURCE_SETTINGS)) { | ||||
\App\Jobs\Resource\UpdateJob::dispatch($resourceSetting->resource_id); | $props = [$resourceSetting->key => null]; | ||||
\App\Jobs\Resource\UpdateJob::dispatch($resourceSetting->resource_id, $props); | |||||
} | } | ||||
} | } | ||||
/** | /** | ||||
* Handle the resource setting "updated" event. | * Handle the resource setting "updated" event. | ||||
* | * | ||||
* @param \App\ResourceSetting $resourceSetting Settings object | * @param \App\ResourceSetting $resourceSetting Settings object | ||||
* | * | ||||
* @return void | * @return void | ||||
*/ | */ | ||||
public function updated(ResourceSetting $resourceSetting) | public function updated(ResourceSetting $resourceSetting) | ||||
{ | { | ||||
if (in_array($resourceSetting->key, LDAP::RESOURCE_SETTINGS)) { | if (in_array($resourceSetting->key, LDAP::RESOURCE_SETTINGS)) { | ||||
\App\Jobs\Resource\UpdateJob::dispatch($resourceSetting->resource_id); | $props = [$resourceSetting->key => $resourceSetting->getOriginal('value')]; | ||||
\App\Jobs\Resource\UpdateJob::dispatch($resourceSetting->resource_id, $props); | |||||
} | } | ||||
} | } | ||||
/** | /** | ||||
* Handle the resource setting "deleted" event. | * Handle the resource setting "deleted" event. | ||||
* | * | ||||
* @param \App\ResourceSetting $resourceSetting Settings object | * @param \App\ResourceSetting $resourceSetting Settings object | ||||
* | * | ||||
* @return void | * @return void | ||||
*/ | */ | ||||
public function deleted(ResourceSetting $resourceSetting) | public function deleted(ResourceSetting $resourceSetting) | ||||
{ | { | ||||
if (in_array($resourceSetting->key, LDAP::RESOURCE_SETTINGS)) { | if (in_array($resourceSetting->key, LDAP::RESOURCE_SETTINGS)) { | ||||
\App\Jobs\Resource\UpdateJob::dispatch($resourceSetting->resource_id); | $props = [$resourceSetting->key => $resourceSetting->getOriginal('value')]; | ||||
\App\Jobs\Resource\UpdateJob::dispatch($resourceSetting->resource_id, $props); | |||||
} | } | ||||
} | } | ||||
} | } |