Files
animethemes-server/app/Events/Admin/Setting/SettingEvent.php
T
paranarimasu 088ea287c5 feat: initial migration to pennant features for feature flags and global site config [incremental] (#573)
* feat: initial commit for feature management

* style: fix StyleCI findings

* fix(api): prohibit features of nonnull scope from API & fix(admin): wrong translate key

* style: fix Static Analysis error
2023-04-23 18:54:34 -05:00

57 lines
1.1 KiB
PHP

<?php
declare(strict_types=1);
namespace App\Events\Admin\Setting;
use App\Constants\Config\ServiceConstants;
use App\Contracts\Events\DiscordMessageEvent;
use App\Models\Admin\Setting;
use Illuminate\Support\Facades\Config;
/**
* Class SettingEvent.
*/
abstract class SettingEvent implements DiscordMessageEvent
{
/**
* Create a new event instance.
*
* @param Setting $setting
* @return void
*/
public function __construct(protected Setting $setting)
{
}
/**
* Get the setting that has fired this event.
*
* @return Setting
*/
public function getSetting(): Setting
{
return $this->setting;
}
/**
* Get Discord channel the message will be sent to.
*
* @return string
*/
public function getDiscordChannel(): string
{
return Config::get(ServiceConstants::ADMIN_DISCORD_CHANNEL_QUALIFIED);
}
/**
* Determine if the message should be sent.
*
* @return bool
*/
public function shouldSendDiscordMessage(): bool
{
return true;
}
}