mirror of
https://github.com/AnimeThemes/animethemes-server.git
synced 2026-09-03 11:15:04 +02:00
67 lines
1.2 KiB
PHP
67 lines
1.2 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Filament\Tabs;
|
|
|
|
use Filament\Resources\Components\Tab;
|
|
use Illuminate\Database\Eloquent\Builder;
|
|
|
|
/**
|
|
* Class BaseTab.
|
|
*/
|
|
abstract class BaseTab extends Tab
|
|
{
|
|
/**
|
|
* Get the key for the tab.
|
|
*
|
|
* @return string
|
|
*
|
|
* @noinspection PhpMissingParentCallCommonInspection
|
|
*/
|
|
abstract static public function getKey(): string;
|
|
|
|
/**
|
|
* Get the displayable name of the tab.
|
|
*
|
|
* @return string
|
|
*
|
|
* @noinspection PhpMissingParentCallCommonInspection
|
|
*/
|
|
public function getLabel(): string
|
|
{
|
|
return $this->getLabel();
|
|
}
|
|
|
|
/**
|
|
* The query used to refine the models for the tab.
|
|
*
|
|
* @param Builder $query
|
|
* @return Builder
|
|
*/
|
|
public function modifyQuery(Builder $query): Builder
|
|
{
|
|
return $this->modifyQuery($query);
|
|
}
|
|
|
|
/**
|
|
* Get the badge for the tab.
|
|
*
|
|
* @return int
|
|
*/
|
|
public function getBadge(): int
|
|
{
|
|
return $this->getBadge();
|
|
}
|
|
|
|
/**
|
|
* Determine if the tab should be hidden.
|
|
*
|
|
* @return bool
|
|
*/
|
|
public function shouldBeHidden(): bool
|
|
{
|
|
return $this->getBadge() === 0;
|
|
}
|
|
}
|