mirror of
https://github.com/Cybrarist/Discount-Bandit.git
synced 2026-11-24 19:49:54 +01:00
55 lines
1.0 KiB
PHP
55 lines
1.0 KiB
PHP
<?php
|
|
|
|
namespace App\Observers;
|
|
|
|
use App\Helpers\CacheHelper;
|
|
use App\Models\Store;
|
|
use Illuminate\Support\Facades\Artisan;
|
|
|
|
class StoreObserver
|
|
{
|
|
/**
|
|
* Handle the Store "created" event.
|
|
*/
|
|
public function saved(Store $store): void
|
|
{
|
|
Artisan::call('discount:fill-supervisor-workers');
|
|
|
|
if ($store->wasRecentlyCreated || $store->wasChanged('short_url_hosts')) {
|
|
CacheHelper::forget_short_url_hosts();
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Handle the Store "updated" event.
|
|
*/
|
|
public function updated(Store $store): void
|
|
{
|
|
//
|
|
}
|
|
|
|
/**
|
|
* Handle the Store "deleted" event.
|
|
*/
|
|
public function deleted(Store $store): void
|
|
{
|
|
CacheHelper::forget_short_url_hosts();
|
|
}
|
|
|
|
/**
|
|
* Handle the Store "restored" event.
|
|
*/
|
|
public function restored(Store $store): void
|
|
{
|
|
//
|
|
}
|
|
|
|
/**
|
|
* Handle the Store "force deleted" event.
|
|
*/
|
|
public function forceDeleted(Store $store): void
|
|
{
|
|
//
|
|
}
|
|
}
|