mirror of
https://github.com/Deathgarden-Rebirth/Deathgarden_Rebirth-Rewrite.git
synced 2026-04-03 16:25:26 -05:00
68 lines
1.5 KiB
PHP
68 lines
1.5 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\Web\Admin\Tools;
|
|
|
|
use App\Enums\Auth\Permissions;
|
|
use App\Http\Controllers\Controller;
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\Support\Facades\View;
|
|
|
|
abstract class AdminToolController extends Controller
|
|
{
|
|
protected static string $name;
|
|
|
|
protected static string $description;
|
|
|
|
protected static string $iconComponent;
|
|
|
|
protected static Permissions $neededPermission;
|
|
|
|
public function __construct()
|
|
{
|
|
$this->overrideTitle(static::$name);
|
|
}
|
|
|
|
/**
|
|
* @return AdminToolController[]|string[]
|
|
*/
|
|
final public static function getAllTools(): array
|
|
{
|
|
return [
|
|
GameNewsController::class,
|
|
FileManagerController::class,
|
|
LogViewerController::class,
|
|
UsersController::class,
|
|
ChatMessageController::class,
|
|
InboxMailerController::class,
|
|
];
|
|
}
|
|
|
|
public static function getNotificationText(): ?string {
|
|
return null;
|
|
}
|
|
|
|
final public static function getName(): string
|
|
{
|
|
return static::$name;
|
|
}
|
|
|
|
final public static function getDescription(): string
|
|
{
|
|
return static::$description;
|
|
}
|
|
|
|
final public static function getIconComponent(): string
|
|
{
|
|
return static::$iconComponent;
|
|
}
|
|
|
|
final public static function getNeededPermission(): string
|
|
{
|
|
return static::$neededPermission->value;
|
|
}
|
|
|
|
final protected function overrideTitle(string $title): void {
|
|
View::share('title', $title);
|
|
}
|
|
}
|