mirror of
https://github.com/AnimeThemes/animethemes-server.git
synced 2026-07-28 09:44:42 +02:00
* 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
35 lines
750 B
PHP
35 lines
750 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Events\Admin\Feature;
|
|
|
|
use App\Enums\Discord\EmbedColor;
|
|
use Illuminate\Foundation\Events\Dispatchable;
|
|
use Illuminate\Queue\SerializesModels;
|
|
use NotificationChannels\Discord\DiscordMessage;
|
|
|
|
/**
|
|
* Class FeatureCreated.
|
|
*/
|
|
class FeatureCreated extends FeatureEvent
|
|
{
|
|
use Dispatchable;
|
|
use SerializesModels;
|
|
|
|
/**
|
|
* Get Discord message payload.
|
|
*
|
|
* @return DiscordMessage
|
|
*/
|
|
public function getDiscordMessage(): DiscordMessage
|
|
{
|
|
$feature = $this->getFeature();
|
|
|
|
return DiscordMessage::create('', [
|
|
'description' => "Feature '**{$feature->getName()}**' has been created.",
|
|
'color' => EmbedColor::GREEN,
|
|
]);
|
|
}
|
|
}
|