mirror of
https://github.com/AnimeThemes/animethemes-server.git
synced 2026-10-18 00:30:47 +02:00
* feat: add playlist resources * style: fix StyleCI findings * fix(admin): address nova exceptions
43 lines
1.0 KiB
PHP
43 lines
1.0 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Events\Pivot\Wiki\AnimeResource;
|
|
|
|
use App\Events\Base\Pivot\PivotUpdatedEvent;
|
|
use App\Models\Wiki\Anime;
|
|
use App\Models\Wiki\ExternalResource;
|
|
use App\Pivots\Wiki\AnimeResource;
|
|
|
|
/**
|
|
* Class AnimeResourceUpdated.
|
|
*
|
|
* @extends PivotUpdatedEvent<Anime, ExternalResource>
|
|
*/
|
|
class AnimeResourceUpdated extends PivotUpdatedEvent
|
|
{
|
|
/**
|
|
* Create a new event instance.
|
|
*
|
|
* @param AnimeResource $animeResource
|
|
*/
|
|
public function __construct(AnimeResource $animeResource)
|
|
{
|
|
parent::__construct($animeResource->anime, $animeResource->resource);
|
|
$this->initializeEmbedFields($animeResource);
|
|
}
|
|
|
|
/**
|
|
* Get the description for the Discord message payload.
|
|
*
|
|
* @return string
|
|
*/
|
|
protected function getDiscordMessageDescription(): string
|
|
{
|
|
$foreign = $this->getForeign();
|
|
$related = $this->getRelated();
|
|
|
|
return "Resource '**{$foreign->getName()}**' for Anime '**{$related->getName()}**' has been updated.";
|
|
}
|
|
}
|