mirror of
https://github.com/AnimeThemes/animethemes-server.git
synced 2026-10-14 14:50:44 +02:00
* feat: support images for studios * style: fix StyleCI findings * fix(admin): throw exception for image request * style: fix StyleCI findings * style: remove extraneous constant * fix(admin): resources mapping may not exist when sending pipe notification * style: fix StyleCI findings
42 lines
955 B
PHP
42 lines
955 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Events\Pivot\StudioImage;
|
|
|
|
use App\Events\Base\Pivot\PivotCreatedEvent;
|
|
use App\Models\Wiki\Image;
|
|
use App\Models\Wiki\Studio;
|
|
use App\Pivots\StudioImage;
|
|
|
|
/**
|
|
* Class StudioImageCreated.
|
|
*
|
|
* @extends PivotCreatedEvent<Studio, Image>
|
|
*/
|
|
class StudioImageCreated extends PivotCreatedEvent
|
|
{
|
|
/**
|
|
* Create a new event instance.
|
|
*
|
|
* @param StudioImage $studioImage
|
|
*/
|
|
public function __construct(StudioImage $studioImage)
|
|
{
|
|
parent::__construct($studioImage->studio, $studioImage->image);
|
|
}
|
|
|
|
/**
|
|
* Get the description for the Discord message payload.
|
|
*
|
|
* @return string
|
|
*/
|
|
protected function getDiscordMessageDescription(): string
|
|
{
|
|
$foreign = $this->getForeign();
|
|
$related = $this->getRelated();
|
|
|
|
return "Image '**{$foreign->getName()}**' has been attached to Studio '**{$related->getName()}**'.";
|
|
}
|
|
}
|