mirror of
https://github.com/AnimeThemes/animethemes-server.git
synced 2026-10-17 16:20:49 +02:00
111 lines
2.6 KiB
PHP
111 lines
2.6 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Filament\RelationManagers\Wiki;
|
|
|
|
use App\Filament\RelationManagers\BaseRelationManager;
|
|
use App\Filament\Resources\Wiki\Artist as ArtistResource;
|
|
use App\Models\Wiki\Artist;
|
|
use Filament\Forms\Form;
|
|
use Filament\Tables\Table;
|
|
|
|
/**
|
|
* Class ArtistRelationManager.
|
|
*/
|
|
abstract class ArtistRelationManager extends BaseRelationManager
|
|
{
|
|
/**
|
|
* The form to the actions.
|
|
*
|
|
* @param Form $form
|
|
* @return Form
|
|
*
|
|
* @noinspection PhpMissingParentCallCommonInspection
|
|
*/
|
|
public function form(Form $form): Form
|
|
{
|
|
return ArtistResource::form($form);
|
|
}
|
|
|
|
/**
|
|
* The index page of the resource.
|
|
*
|
|
* @param Table $table
|
|
* @return Table
|
|
*
|
|
* @noinspection PhpMissingParentCallCommonInspection
|
|
*/
|
|
public function table(Table $table): Table
|
|
{
|
|
return parent::table(
|
|
$table
|
|
->heading(ArtistResource::getPluralLabel())
|
|
->modelLabel(ArtistResource::getLabel())
|
|
->recordTitleAttribute(Artist::ATTRIBUTE_NAME)
|
|
->columns(ArtistResource::table($table)->getColumns())
|
|
->defaultSort(Artist::TABLE . '.' . Artist::ATTRIBUTE_ID, 'desc')
|
|
);
|
|
}
|
|
|
|
/**
|
|
* Get the filters available for the relation.
|
|
*
|
|
* @return array
|
|
*
|
|
* @noinspection PhpMissingParentCallCommonInspection
|
|
*/
|
|
public static function getFilters(): array
|
|
{
|
|
return array_merge(
|
|
[],
|
|
ArtistResource::getFilters(),
|
|
);
|
|
}
|
|
|
|
/**
|
|
* Get the actions available for the relation.
|
|
*
|
|
* @return array
|
|
*
|
|
* @noinspection PhpMissingParentCallCommonInspection
|
|
*/
|
|
public static function getActions(): array
|
|
{
|
|
return array_merge(
|
|
parent::getActions(),
|
|
ArtistResource::getActions(),
|
|
);
|
|
}
|
|
|
|
/**
|
|
* Get the bulk actions available for the relation.
|
|
*
|
|
* @return array
|
|
*
|
|
* @noinspection PhpMissingParentCallCommonInspection
|
|
*/
|
|
public static function getBulkActions(): array
|
|
{
|
|
return array_merge(
|
|
parent::getBulkActions(),
|
|
ArtistResource::getBulkActions(),
|
|
);
|
|
}
|
|
|
|
/**
|
|
* Get the header actions available for the relation.
|
|
*
|
|
* @return array
|
|
*
|
|
* @noinspection PhpMissingParentCallCommonInspection
|
|
*/
|
|
public static function getHeaderActions(): array
|
|
{
|
|
return array_merge(
|
|
parent::getHeaderActions(),
|
|
ArtistResource::getHeaderActions(),
|
|
);
|
|
}
|
|
}
|