mirror of
https://github.com/AnimeThemes/animethemes-server.git
synced 2026-07-26 08:44:30 +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
57 lines
1.0 KiB
PHP
57 lines
1.0 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Events\Auth\User;
|
|
|
|
use App\Constants\Config\ServiceConstants;
|
|
use App\Contracts\Events\DiscordMessageEvent;
|
|
use App\Models\Auth\User;
|
|
use Illuminate\Support\Facades\Config;
|
|
|
|
/**
|
|
* Class UserEvent.
|
|
*/
|
|
abstract class UserEvent implements DiscordMessageEvent
|
|
{
|
|
/**
|
|
* Create a new event instance.
|
|
*
|
|
* @param User $user
|
|
* @return void
|
|
*/
|
|
public function __construct(protected User $user)
|
|
{
|
|
}
|
|
|
|
/**
|
|
* Get the user that has fired this event.
|
|
*
|
|
* @return User
|
|
*/
|
|
public function getUser(): User
|
|
{
|
|
return $this->user;
|
|
}
|
|
|
|
/**
|
|
* 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;
|
|
}
|
|
}
|