mirror of
https://github.com/AnimeThemes/animethemes-server.git
synced 2026-11-13 17:48:49 +01:00
refactor(filament): relation managers (#696)
This commit is contained in:
1 parent
376e3a96a3
commit
67f4cd83ce
80 files changed
+2127
-1165
No files matched your search
@@ -4,7 +4,6 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Filament\Components\Columns;
|
||||
|
||||
use App\Filament\Resources\BaseRelationManager;
|
||||
use App\Filament\Resources\BaseResource;
|
||||
use App\Models\BaseModel;
|
||||
use Filament\Support\Enums\FontWeight;
|
||||
@@ -57,6 +56,7 @@ class TextColumn extends ColumnsTextColumn
|
||||
{
|
||||
return $this
|
||||
->copyable($condition)
|
||||
->copyMessage(__('filament.actions.base.copied'));
|
||||
->copyMessage(__('filament.actions.base.copied'))
|
||||
->icon('heroicon-o-clipboard');
|
||||
}
|
||||
}
|
||||
@@ -15,23 +15,9 @@ use Illuminate\Support\Arr;
|
||||
*/
|
||||
class DateFilter extends Filter
|
||||
{
|
||||
protected string $attribute = '';
|
||||
protected string $fromLabel = '';
|
||||
protected string $toLabel = '';
|
||||
|
||||
/**
|
||||
* Get the attribute used for filter.
|
||||
*
|
||||
* @param string $attribute
|
||||
* @return static
|
||||
*/
|
||||
public function attribute(string $attribute): static
|
||||
{
|
||||
$this->attribute = $attribute;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the label for the filters.
|
||||
*
|
||||
@@ -55,10 +41,10 @@ class DateFilter extends Filter
|
||||
public function getFormSchema(): array
|
||||
{
|
||||
return [
|
||||
DatePicker::make($this->attribute.'_'.'from')
|
||||
DatePicker::make($this->getName().'_'.'from')
|
||||
->label($this->fromLabel),
|
||||
|
||||
DatePicker::make($this->attribute.'_'.'to')
|
||||
DatePicker::make($this->getName().'_'.'to')
|
||||
->label($this->toLabel),
|
||||
];
|
||||
}
|
||||
@@ -74,12 +60,12 @@ class DateFilter extends Filter
|
||||
{
|
||||
return $query
|
||||
->when(
|
||||
Arr::get($data, $this->attribute.'_'.'from'),
|
||||
fn (Builder $query, $date): Builder => $query->whereDate($this->attribute, ComparisonOperator::GTE->value, $date),
|
||||
Arr::get($data, $this->getName().'_'.'from'),
|
||||
fn (Builder $query, $date): Builder => $query->whereDate($this->getName(), ComparisonOperator::GTE->value, $date),
|
||||
)
|
||||
->when(
|
||||
Arr::get($data, $this->attribute.'_'.'to'),
|
||||
fn (Builder $query, $date): Builder => $query->whereDate($this->attribute, ComparisonOperator::LTE->value, $date),
|
||||
Arr::get($data, $this->getName().'_'.'to'),
|
||||
fn (Builder $query, $date): Builder => $query->whereDate($this->getName(), ComparisonOperator::LTE->value, $date),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -15,23 +15,9 @@ use Illuminate\Support\Arr;
|
||||
*/
|
||||
class NumberFilter extends Filter
|
||||
{
|
||||
protected string $attribute = '';
|
||||
protected string $fromLabel = '';
|
||||
protected string $toLabel = '';
|
||||
|
||||
/**
|
||||
* Get the attribute used for filter.
|
||||
*
|
||||
* @param string $attribute
|
||||
* @return static
|
||||
*/
|
||||
public function attribute(string $attribute): static
|
||||
{
|
||||
$this->attribute = $attribute;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the label for the filters.
|
||||
*
|
||||
@@ -56,11 +42,11 @@ class NumberFilter extends Filter
|
||||
public function getFormSchema(): array
|
||||
{
|
||||
return [
|
||||
TextInput::make($this->attribute.'_'.'from')
|
||||
TextInput::make($this->getName().'_'.'from')
|
||||
->label($this->fromLabel)
|
||||
->integer(),
|
||||
|
||||
TextInput::make($this->attribute.'_'.'to')
|
||||
TextInput::make($this->getName().'_'.'to')
|
||||
->label($this->toLabel)
|
||||
->integer(),
|
||||
];
|
||||
@@ -77,12 +63,12 @@ class NumberFilter extends Filter
|
||||
{
|
||||
return $query
|
||||
->when(
|
||||
Arr::get($data, $this->attribute.'_'.'from'),
|
||||
fn (Builder $query, $value): Builder => $query->where($this->attribute, ComparisonOperator::GTE->value, $value),
|
||||
Arr::get($data, $this->getName().'_'.'from'),
|
||||
fn (Builder $query, $value): Builder => $query->where($this->getName(), ComparisonOperator::GTE->value, $value),
|
||||
)
|
||||
->when(
|
||||
Arr::get($data, $this->attribute.'_'.'to'),
|
||||
fn (Builder $query, $value): Builder => $query->where($this->attribute, ComparisonOperator::LTE->value, $value),
|
||||
Arr::get($data, $this->getName().'_'.'to'),
|
||||
fn (Builder $query, $value): Builder => $query->where($this->getName(), ComparisonOperator::LTE->value, $value),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -14,21 +14,6 @@ use Illuminate\Support\Arr;
|
||||
*/
|
||||
class TextFilter extends Filter
|
||||
{
|
||||
protected string $attribute = '';
|
||||
|
||||
/**
|
||||
* Get the attribute used for filter.
|
||||
*
|
||||
* @param string $attribute
|
||||
* @return static
|
||||
*/
|
||||
public function attribute(string $attribute): static
|
||||
{
|
||||
$this->attribute = $attribute;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the form for the filter.
|
||||
*
|
||||
@@ -37,7 +22,7 @@ class TextFilter extends Filter
|
||||
public function getFormSchema(): array
|
||||
{
|
||||
return [
|
||||
TextInput::make($this->attribute)
|
||||
TextInput::make($this->getName())
|
||||
->label($this->label),
|
||||
];
|
||||
}
|
||||
@@ -51,8 +36,8 @@ class TextFilter extends Filter
|
||||
*/
|
||||
public function applyToBaseQuery(Builder $query, array $data = []): Builder
|
||||
{
|
||||
return Arr::get($data, $this->attribute) !== null
|
||||
? $query->where($this->attribute, Arr::get($data, $this->attribute))
|
||||
return Arr::get($data, $this->getName()) !== null
|
||||
? $query->where($this->getName(), Arr::get($data, $this->getName()))
|
||||
: $query;
|
||||
}
|
||||
}
|
||||
@@ -53,6 +53,7 @@ class TextEntry extends ComponentsTextEntry
|
||||
{
|
||||
return $this
|
||||
->copyable($condition)
|
||||
->copyMessage(__('filament.actions.base.copied'));
|
||||
->copyMessage(__('filament.actions.base.copied'))
|
||||
->icon('heroicon-o-clipboard');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Filament\RelationManagers\Auth;
|
||||
|
||||
use App\Filament\RelationManagers\BaseRelationManager;
|
||||
use App\Filament\Resources\Auth\Permission as PermissionResource;
|
||||
use App\Models\Auth\Permission;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Tables\Table;
|
||||
|
||||
/**
|
||||
* Class PermissionRelationManager.
|
||||
*/
|
||||
abstract class PermissionRelationManager extends BaseRelationManager
|
||||
{
|
||||
/**
|
||||
* The form to the actions.
|
||||
*
|
||||
* @param Form $form
|
||||
* @return Form
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public function form(Form $form): Form
|
||||
{
|
||||
return PermissionResource::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(PermissionResource::getPluralLabel())
|
||||
->modelLabel(PermissionResource::getLabel())
|
||||
->recordTitleAttribute(Permission::ATTRIBUTE_NAME)
|
||||
->columns(PermissionResource::table($table)->getColumns())
|
||||
->defaultSort(Permission::TABLE . '.' . Permission::ATTRIBUTE_ID, 'desc')
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the filters available for the relation.
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public static function getFilters(): array
|
||||
{
|
||||
return array_merge(
|
||||
[],
|
||||
PermissionResource::getFilters(),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the actions available for the relation.
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public static function getActions(): array
|
||||
{
|
||||
return PermissionResource::getActions();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the bulk actions available for the relation.
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public static function getBulkActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getBulkActions(),
|
||||
PermissionResource::getBulkActions(),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the header actions available for the relation.
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public static function getHeaderActions(): array
|
||||
{
|
||||
return PermissionResource::getHeaderActions();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Filament\RelationManagers\Auth;
|
||||
|
||||
use App\Filament\RelationManagers\BaseRelationManager;
|
||||
use App\Filament\Resources\Auth\Role as RoleResource;
|
||||
use App\Models\Auth\Role;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Tables\Actions\ViewAction;
|
||||
use Filament\Tables\Table;
|
||||
|
||||
/**
|
||||
* Class RoleRelationManager.
|
||||
*/
|
||||
abstract class RoleRelationManager extends BaseRelationManager
|
||||
{
|
||||
/**
|
||||
* The form to the actions.
|
||||
*
|
||||
* @param Form $form
|
||||
* @return Form
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public function form(Form $form): Form
|
||||
{
|
||||
return RoleResource::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(RoleResource::getPluralLabel())
|
||||
->modelLabel(RoleResource::getLabel())
|
||||
->recordTitleAttribute(Role::ATTRIBUTE_NAME)
|
||||
->columns(RoleResource::table($table)->getColumns())
|
||||
->defaultSort(Role::TABLE . '.' . Role::ATTRIBUTE_ID, 'desc')
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the filters available for the relation.
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public static function getFilters(): array
|
||||
{
|
||||
return array_merge(
|
||||
[],
|
||||
RoleResource::getFilters(),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the actions available for the relation.
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public static function getActions(): array
|
||||
{
|
||||
return [
|
||||
ViewAction::make(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the bulk actions available for the relation.
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public static function getBulkActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getBulkActions(),
|
||||
RoleResource::getBulkActions(),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the header actions available for the relation.
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public static function getHeaderActions(): array
|
||||
{
|
||||
return RoleResource::getHeaderActions();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Filament\RelationManagers\Auth;
|
||||
|
||||
use App\Filament\RelationManagers\BaseRelationManager;
|
||||
use App\Filament\Resources\Auth\User as UserResource;
|
||||
use App\Models\Auth\User;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Tables\Table;
|
||||
|
||||
/**
|
||||
* Class UserRelationManager.
|
||||
*/
|
||||
abstract class UserRelationManager extends BaseRelationManager
|
||||
{
|
||||
/**
|
||||
* The form to the actions.
|
||||
*
|
||||
* @param Form $form
|
||||
* @return Form
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public function form(Form $form): Form
|
||||
{
|
||||
return UserResource::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(UserResource::getPluralLabel())
|
||||
->modelLabel(UserResource::getLabel())
|
||||
->recordTitleAttribute(User::ATTRIBUTE_NAME)
|
||||
->columns(UserResource::table($table)->getColumns())
|
||||
->defaultSort(User::TABLE . '.' . User::ATTRIBUTE_ID, 'desc')
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the filters available for the relation.
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public static function getFilters(): array
|
||||
{
|
||||
return array_merge(
|
||||
[],
|
||||
UserResource::getFilters(),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the actions available for the relation.
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public static function getActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getActions(),
|
||||
UserResource::getActions(),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the bulk actions available for the relation.
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public static function getBulkActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getBulkActions(),
|
||||
UserResource::getBulkActions(),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the header actions available for the relation.
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public static function getHeaderActions(): array
|
||||
{
|
||||
return UserResource::getHeaderActions();
|
||||
}
|
||||
}
|
||||
+8
-41
@@ -2,36 +2,24 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Filament\Resources;
|
||||
namespace App\Filament\RelationManagers;
|
||||
|
||||
use App\Filament\Components\Fields\Select;
|
||||
use App\Filament\Resources\Wiki\Anime\RelationManagers\ResourceAnimeRelationManager;
|
||||
use App\Filament\Resources\Wiki\Artist\RelationManagers\ResourceArtistRelationManager;
|
||||
use App\Filament\RelationManagers\Wiki\ResourceRelationManager;
|
||||
use App\Filament\Resources\Wiki\Artist\RelationManagers\SongArtistRelationManager;
|
||||
use App\Filament\Resources\Wiki\ExternalResource\RelationManagers\AnimeResourceRelationManager;
|
||||
use App\Filament\Resources\Wiki\ExternalResource\RelationManagers\ArtistResourceRelationManager;
|
||||
use App\Filament\Resources\Wiki\ExternalResource\RelationManagers\SongResourceRelationManager;
|
||||
use App\Filament\Resources\Wiki\ExternalResource\RelationManagers\StudioResourceRelationManager;
|
||||
use App\Filament\Resources\Wiki\Song\RelationManagers\ArtistSongRelationManager;
|
||||
use App\Filament\Resources\Wiki\Song\RelationManagers\ResourceSongRelationManager;
|
||||
use App\Filament\Resources\Wiki\Studio\RelationManagers\ResourceStudioRelationManager;
|
||||
use App\Pivots\Wiki\AnimeResource;
|
||||
use App\Pivots\Wiki\ArtistResource;
|
||||
use App\Pivots\Wiki\ArtistSong;
|
||||
use App\Pivots\Wiki\StudioResource;
|
||||
use Filament\Forms\Components\TextInput;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Resources\RelationManagers\RelationManager;
|
||||
use Filament\Tables\Actions\AttachAction;
|
||||
use Filament\Tables\Actions\BulkActionGroup;
|
||||
use Filament\Tables\Actions\CreateAction;
|
||||
use Filament\Tables\Actions\DeleteBulkAction;
|
||||
use Filament\Tables\Actions\DetachAction;
|
||||
use Filament\Tables\Actions\DetachBulkAction;
|
||||
use Filament\Tables\Actions\EditAction;
|
||||
use Filament\Tables\Actions\ForceDeleteBulkAction;
|
||||
use Filament\Tables\Actions\RestoreBulkAction;
|
||||
use Filament\Tables\Actions\ViewAction;
|
||||
use Filament\Tables\Filters\TrashedFilter;
|
||||
use Filament\Tables\Table;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||
@@ -41,6 +29,8 @@ use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||
*/
|
||||
abstract class BaseRelationManager extends RelationManager
|
||||
{
|
||||
protected static bool $isLazy = false;
|
||||
|
||||
/**
|
||||
* The index page of the relation resource.
|
||||
*
|
||||
@@ -84,16 +74,7 @@ abstract class BaseRelationManager extends RelationManager
|
||||
*/
|
||||
public static function getActions(): array
|
||||
{
|
||||
return [
|
||||
ViewAction::make()
|
||||
->label(__('filament.actions.base.view')),
|
||||
|
||||
EditAction::make()
|
||||
->label(__('filament.actions.base.edit')),
|
||||
|
||||
DetachAction::make()
|
||||
->label(__('filament.actions.base.detach')),
|
||||
];
|
||||
return [];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -106,19 +87,8 @@ abstract class BaseRelationManager extends RelationManager
|
||||
public static function getBulkActions(): array
|
||||
{
|
||||
return [
|
||||
BulkActionGroup::make([
|
||||
DeleteBulkAction::make()
|
||||
->label(__('filament.bulk_actions.base.delete')),
|
||||
|
||||
ForceDeleteBulkAction::make()
|
||||
->label(__('filament.bulk_actions.base.forcedelete')),
|
||||
|
||||
RestoreBulkAction::make()
|
||||
->label(__('filament.bulk_actions.base.restore')),
|
||||
|
||||
DetachBulkAction::make()
|
||||
->label(__('filament.bulk_actions.base.detach')),
|
||||
]),
|
||||
DetachBulkAction::make()
|
||||
->label(__('filament.bulk_actions.base.detach')),
|
||||
];
|
||||
}
|
||||
|
||||
@@ -157,10 +127,7 @@ abstract class BaseRelationManager extends RelationManager
|
||||
ArtistResourceRelationManager::class,
|
||||
SongResourceRelationManager::class,
|
||||
StudioResourceRelationManager::class,
|
||||
ResourceAnimeRelationManager::class,
|
||||
ResourceArtistRelationManager::class,
|
||||
ResourceSongRelationManager::class,
|
||||
ResourceStudioRelationManager::class,
|
||||
ResourceRelationManager::class,
|
||||
]),
|
||||
|
||||
TextInput::make(ArtistSong::ATTRIBUTE_AS)
|
||||
@@ -0,0 +1,110 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Filament\RelationManagers\List\Playlist;
|
||||
|
||||
use App\Filament\RelationManagers\BaseRelationManager;
|
||||
use App\Filament\Resources\List\Playlist\Track as TrackResource;
|
||||
use App\Models\List\Playlist\PlaylistTrack;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Tables\Table;
|
||||
|
||||
/**
|
||||
* Class TrackRelationManager.
|
||||
*/
|
||||
abstract class TrackRelationManager extends BaseRelationManager
|
||||
{
|
||||
/**
|
||||
* The form to the actions.
|
||||
*
|
||||
* @param Form $form
|
||||
* @return Form
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public function form(Form $form): Form
|
||||
{
|
||||
return TrackResource::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(TrackResource::getPluralLabel())
|
||||
->modelLabel(TrackResource::getLabel())
|
||||
->recordTitleAttribute(PlaylistTrack::ATTRIBUTE_HASHID)
|
||||
->columns(TrackResource::table($table)->getColumns())
|
||||
->defaultSort(PlaylistTrack::TABLE . '.' . PlaylistTrack::ATTRIBUTE_ID, 'desc')
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the filters available for the relation.
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public static function getFilters(): array
|
||||
{
|
||||
return array_merge(
|
||||
[],
|
||||
TrackResource::getFilters(),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the actions available for the relation.
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public static function getActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getActions(),
|
||||
TrackResource::getActions(),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the bulk actions available for the relation.
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public static function getBulkActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getBulkActions(),
|
||||
TrackResource::getBulkActions(),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the header actions available for the relation.
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public static function getHeaderActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getHeaderActions(),
|
||||
TrackResource::getHeaderActions(),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,110 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Filament\RelationManagers\List;
|
||||
|
||||
use App\Filament\RelationManagers\BaseRelationManager;
|
||||
use App\Filament\Resources\List\Playlist as PlaylistResource;
|
||||
use App\Models\List\Playlist;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Tables\Table;
|
||||
|
||||
/**
|
||||
* Class PlaylistRelationManager.
|
||||
*/
|
||||
abstract class PlaylistRelationManager extends BaseRelationManager
|
||||
{
|
||||
/**
|
||||
* The form to the actions.
|
||||
*
|
||||
* @param Form $form
|
||||
* @return Form
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public function form(Form $form): Form
|
||||
{
|
||||
return PlaylistResource::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(PlaylistResource::getPluralLabel())
|
||||
->modelLabel(PlaylistResource::getLabel())
|
||||
->recordTitleAttribute(Playlist::ATTRIBUTE_NAME)
|
||||
->columns(PlaylistResource::table($table)->getColumns())
|
||||
->defaultSort(Playlist::TABLE . '.' . Playlist::ATTRIBUTE_ID, 'desc')
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the filters available for the relation.
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public static function getFilters(): array
|
||||
{
|
||||
return array_merge(
|
||||
[],
|
||||
PlaylistResource::getFilters(),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the actions available for the relation.
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public static function getActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getActions(),
|
||||
PlaylistResource::getActions(),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the bulk actions available for the relation.
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public static function getBulkActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getBulkActions(),
|
||||
PlaylistResource::getBulkActions(),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the header actions available for the relation.
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public static function getHeaderActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getHeaderActions(),
|
||||
PlaylistResource::getHeaderActions(),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,110 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Filament\RelationManagers\Wiki\Anime;
|
||||
|
||||
use App\Filament\RelationManagers\BaseRelationManager;
|
||||
use App\Filament\Resources\Wiki\Anime\Synonym as SynonymResource;
|
||||
use App\Models\Wiki\Anime\AnimeSynonym;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Tables\Table;
|
||||
|
||||
/**
|
||||
* Class SynonymRelationManager.
|
||||
*/
|
||||
abstract class SynonymRelationManager extends BaseRelationManager
|
||||
{
|
||||
/**
|
||||
* The form to the actions.
|
||||
*
|
||||
* @param Form $form
|
||||
* @return Form
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public function form(Form $form): Form
|
||||
{
|
||||
return SynonymResource::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(SynonymResource::getPluralLabel())
|
||||
->modelLabel(SynonymResource::getLabel())
|
||||
->recordTitleAttribute(AnimeSynonym::ATTRIBUTE_TEXT)
|
||||
->columns(SynonymResource::table($table)->getColumns())
|
||||
->defaultSort(AnimeSynonym::TABLE . '.' . AnimeSynonym::ATTRIBUTE_ID, 'desc')
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the filters available for the relation.
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public static function getFilters(): array
|
||||
{
|
||||
return array_merge(
|
||||
[],
|
||||
SynonymResource::getFilters(),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the actions available for the relation.
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public static function getActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getActions(),
|
||||
SynonymResource::getActions(),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the bulk actions available for the relation.
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public static function getBulkActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getBulkActions(),
|
||||
SynonymResource::getBulkActions(),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the header actions available for the relation.
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public static function getHeaderActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getHeaderActions(),
|
||||
SynonymResource::getHeaderActions(),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,110 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Filament\RelationManagers\Wiki\Anime\Theme;
|
||||
|
||||
use App\Filament\RelationManagers\BaseRelationManager;
|
||||
use App\Filament\Resources\Wiki\Anime\Theme\Entry as EntryResource;
|
||||
use App\Models\Wiki\Anime\Theme\AnimeThemeEntry;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Tables\Table;
|
||||
|
||||
/**
|
||||
* Class EntryRelationManager.
|
||||
*/
|
||||
abstract class EntryRelationManager extends BaseRelationManager
|
||||
{
|
||||
/**
|
||||
* The form to the actions.
|
||||
*
|
||||
* @param Form $form
|
||||
* @return Form
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public function form(Form $form): Form
|
||||
{
|
||||
return EntryResource::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(EntryResource::getPluralLabel())
|
||||
->modelLabel(EntryResource::getLabel())
|
||||
->recordTitleAttribute(AnimeThemeEntry::ATTRIBUTE_VERSION)
|
||||
->columns(EntryResource::table($table)->getColumns())
|
||||
->defaultSort(AnimeThemeEntry::TABLE . '.' . AnimeThemeEntry::ATTRIBUTE_ID, 'desc')
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the filters available for the relation.
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public static function getFilters(): array
|
||||
{
|
||||
return array_merge(
|
||||
[],
|
||||
EntryResource::getFilters(),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the actions available for the relation.
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public static function getActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getActions(),
|
||||
EntryResource::getActions(),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the bulk actions available for the relation.
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public static function getBulkActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getBulkActions(),
|
||||
EntryResource::getBulkActions(),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the header actions available for the relation.
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public static function getHeaderActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getHeaderActions(),
|
||||
EntryResource::getHeaderActions(),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,110 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Filament\RelationManagers\Wiki\Anime;
|
||||
|
||||
use App\Filament\RelationManagers\BaseRelationManager;
|
||||
use App\Filament\Resources\Wiki\Anime\Theme as ThemeResource;
|
||||
use App\Models\Wiki\Anime\AnimeTheme;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Tables\Table;
|
||||
|
||||
/**
|
||||
* Class ThemeRelationManager.
|
||||
*/
|
||||
abstract class ThemeRelationManager extends BaseRelationManager
|
||||
{
|
||||
/**
|
||||
* The form to the actions.
|
||||
*
|
||||
* @param Form $form
|
||||
* @return Form
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public function form(Form $form): Form
|
||||
{
|
||||
return ThemeResource::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(ThemeResource::getPluralLabel())
|
||||
->modelLabel(ThemeResource::getLabel())
|
||||
->recordTitle(fn ($record) => $record->getName())
|
||||
->columns(ThemeResource::table($table)->getColumns())
|
||||
->defaultSort(AnimeTheme::TABLE . '.' . AnimeTheme::ATTRIBUTE_ID, 'desc')
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the filters available for the relation.
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public static function getFilters(): array
|
||||
{
|
||||
return array_merge(
|
||||
[],
|
||||
ThemeResource::getFilters(),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the actions available for the relation.
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public static function getActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getActions(),
|
||||
ThemeResource::getActions(),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the bulk actions available for the relation.
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public static function getBulkActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getBulkActions(),
|
||||
ThemeResource::getBulkActions(),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the header actions available for the relation.
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public static function getHeaderActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getHeaderActions(),
|
||||
ThemeResource::getHeaderActions(),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,110 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Filament\RelationManagers\Wiki;
|
||||
|
||||
use App\Filament\RelationManagers\BaseRelationManager;
|
||||
use App\Filament\Resources\Wiki\Anime as AnimeResource;
|
||||
use App\Models\Wiki\Anime;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Tables\Table;
|
||||
|
||||
/**
|
||||
* Class AnimeRelationManager.
|
||||
*/
|
||||
abstract class AnimeRelationManager extends BaseRelationManager
|
||||
{
|
||||
/**
|
||||
* The form to the actions.
|
||||
*
|
||||
* @param Form $form
|
||||
* @return Form
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public function form(Form $form): Form
|
||||
{
|
||||
return AnimeResource::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(AnimeResource::getPluralLabel())
|
||||
->modelLabel(AnimeResource::getLabel())
|
||||
->recordTitleAttribute(Anime::ATTRIBUTE_NAME)
|
||||
->columns(AnimeResource::table($table)->getColumns())
|
||||
->defaultSort(Anime::TABLE . '.' . Anime::ATTRIBUTE_ID, 'desc')
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the filters available for the relation.
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public static function getFilters(): array
|
||||
{
|
||||
return array_merge(
|
||||
[],
|
||||
AnimeResource::getFilters(),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the actions available for the relation.
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public static function getActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getActions(),
|
||||
AnimeResource::getActions(),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the bulk actions available for the relation.
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public static function getBulkActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getBulkActions(),
|
||||
AnimeResource::getBulkActions(),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the header actions available for the relation.
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public static function getHeaderActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getHeaderActions(),
|
||||
AnimeResource::getHeaderActions(),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,110 @@
|
||||
<?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(),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,110 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Filament\RelationManagers\Wiki;
|
||||
|
||||
use App\Filament\RelationManagers\BaseRelationManager;
|
||||
use App\Filament\Resources\Wiki\Image as ImageResource;
|
||||
use App\Models\Wiki\Image;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Tables\Table;
|
||||
|
||||
/**
|
||||
* Class ImageRelationManager.
|
||||
*/
|
||||
abstract class ImageRelationManager extends BaseRelationManager
|
||||
{
|
||||
/**
|
||||
* The form to the actions.
|
||||
*
|
||||
* @param Form $form
|
||||
* @return Form
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public function form(Form $form): Form
|
||||
{
|
||||
return ImageResource::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(ImageResource::getPluralLabel())
|
||||
->modelLabel(ImageResource::getLabel())
|
||||
->recordTitleAttribute(Image::ATTRIBUTE_PATH)
|
||||
->columns(ImageResource::table($table)->getColumns())
|
||||
->defaultSort(Image::TABLE . '.' . Image::ATTRIBUTE_ID, 'desc')
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the filters available for the relation.
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public static function getFilters(): array
|
||||
{
|
||||
return array_merge(
|
||||
[],
|
||||
ImageResource::getFilters(),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the actions available for the relation.
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public static function getActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getActions(),
|
||||
ImageResource::getActions(),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the bulk actions available for the relation.
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public static function getBulkActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getBulkActions(),
|
||||
ImageResource::getBulkActions(),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the header actions available for the relation.
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public static function getHeaderActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getHeaderActions(),
|
||||
ImageResource::getHeaderActions(),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,110 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Filament\RelationManagers\Wiki;
|
||||
|
||||
use App\Filament\RelationManagers\BaseRelationManager;
|
||||
use App\Filament\Resources\Wiki\ExternalResource as ExternalResourceResource;
|
||||
use App\Models\Wiki\ExternalResource;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Tables\Table;
|
||||
|
||||
/**
|
||||
* Class ResourceRelationManager.
|
||||
*/
|
||||
abstract class ResourceRelationManager extends BaseRelationManager
|
||||
{
|
||||
/**
|
||||
* The form to the actions.
|
||||
*
|
||||
* @param Form $form
|
||||
* @return Form
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public function form(Form $form): Form
|
||||
{
|
||||
return ExternalResourceResource::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(ExternalResourceResource::getPluralLabel())
|
||||
->modelLabel(ExternalResourceResource::getLabel())
|
||||
->recordTitleAttribute(ExternalResource::ATTRIBUTE_LINK)
|
||||
->columns(ExternalResourceResource::table($table)->getColumns())
|
||||
->defaultSort(ExternalResource::TABLE . '.' . ExternalResource::ATTRIBUTE_ID, 'desc')
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the filters available for the relation.
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public static function getFilters(): array
|
||||
{
|
||||
return array_merge(
|
||||
[],
|
||||
ExternalResourceResource::getFilters(),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the actions available for the relation.
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public static function getActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getActions(),
|
||||
ExternalResourceResource::getActions(),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the bulk actions available for the relation.
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public static function getBulkActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getBulkActions(),
|
||||
ExternalResourceResource::getBulkActions(),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the header actions available for the relation.
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public static function getHeaderActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getHeaderActions(),
|
||||
ExternalResourceResource::getHeaderActions(),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,110 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Filament\RelationManagers\Wiki;
|
||||
|
||||
use App\Filament\RelationManagers\BaseRelationManager;
|
||||
use App\Filament\Resources\Wiki\Series as SeriesResource;
|
||||
use App\Models\Wiki\Series;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Tables\Table;
|
||||
|
||||
/**
|
||||
* Class SeriesRelationManager.
|
||||
*/
|
||||
abstract class SeriesRelationManager extends BaseRelationManager
|
||||
{
|
||||
/**
|
||||
* The form to the actions.
|
||||
*
|
||||
* @param Form $form
|
||||
* @return Form
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public function form(Form $form): Form
|
||||
{
|
||||
return SeriesResource::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(SeriesResource::getPluralLabel())
|
||||
->modelLabel(SeriesResource::getLabel())
|
||||
->recordTitleAttribute(Series::ATTRIBUTE_NAME)
|
||||
->columns(SeriesResource::table($table)->getColumns())
|
||||
->defaultSort(Series::TABLE . '.' . Series::ATTRIBUTE_ID, 'desc')
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the filters available for the relation.
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public static function getFilters(): array
|
||||
{
|
||||
return array_merge(
|
||||
[],
|
||||
SeriesResource::getFilters(),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the actions available for the relation.
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public static function getActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getActions(),
|
||||
SeriesResource::getActions(),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the bulk actions available for the relation.
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public static function getBulkActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getBulkActions(),
|
||||
SeriesResource::getBulkActions(),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the header actions available for the relation.
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public static function getHeaderActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getHeaderActions(),
|
||||
SeriesResource::getHeaderActions(),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,110 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Filament\RelationManagers\Wiki;
|
||||
|
||||
use App\Filament\RelationManagers\BaseRelationManager;
|
||||
use App\Filament\Resources\Wiki\Song as SongResource;
|
||||
use App\Models\Wiki\Song;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Tables\Table;
|
||||
|
||||
/**
|
||||
* Class SongRelationManager.
|
||||
*/
|
||||
abstract class SongRelationManager extends BaseRelationManager
|
||||
{
|
||||
/**
|
||||
* The form to the actions.
|
||||
*
|
||||
* @param Form $form
|
||||
* @return Form
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public function form(Form $form): Form
|
||||
{
|
||||
return SongResource::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(SongResource::getPluralLabel())
|
||||
->modelLabel(SongResource::getLabel())
|
||||
->recordTitleAttribute(Song::ATTRIBUTE_TITLE)
|
||||
->columns(SongResource::table($table)->getColumns())
|
||||
->defaultSort(Song::TABLE . '.' . Song::ATTRIBUTE_ID, 'desc')
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the filters available for the relation.
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public static function getFilters(): array
|
||||
{
|
||||
return array_merge(
|
||||
[],
|
||||
SongResource::getFilters(),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the actions available for the relation.
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public static function getActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getActions(),
|
||||
SongResource::getActions(),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the bulk actions available for the relation.
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public static function getBulkActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getBulkActions(),
|
||||
SongResource::getBulkActions(),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the header actions available for the relation.
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public static function getHeaderActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getHeaderActions(),
|
||||
SongResource::getHeaderActions(),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,110 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Filament\RelationManagers\Wiki;
|
||||
|
||||
use App\Filament\RelationManagers\BaseRelationManager;
|
||||
use App\Filament\Resources\Wiki\Studio as StudioResource;
|
||||
use App\Models\Wiki\Studio;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Tables\Table;
|
||||
|
||||
/**
|
||||
* Class StudioRelationManager.
|
||||
*/
|
||||
abstract class StudioRelationManager extends BaseRelationManager
|
||||
{
|
||||
/**
|
||||
* The form to the actions.
|
||||
*
|
||||
* @param Form $form
|
||||
* @return Form
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public function form(Form $form): Form
|
||||
{
|
||||
return StudioResource::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(StudioResource::getPluralLabel())
|
||||
->modelLabel(StudioResource::getLabel())
|
||||
->recordTitleAttribute(Studio::ATTRIBUTE_NAME)
|
||||
->columns(StudioResource::table($table)->getColumns())
|
||||
->defaultSort(Studio::TABLE . '.' . Studio::ATTRIBUTE_ID, 'desc')
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the filters available for the relation.
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public static function getFilters(): array
|
||||
{
|
||||
return array_merge(
|
||||
[],
|
||||
StudioResource::getFilters(),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the actions available for the relation.
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public static function getActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getActions(),
|
||||
StudioResource::getActions(),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the bulk actions available for the relation.
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public static function getBulkActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getBulkActions(),
|
||||
StudioResource::getBulkActions(),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the header actions available for the relation.
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public static function getHeaderActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getHeaderActions(),
|
||||
StudioResource::getHeaderActions(),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,110 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Filament\RelationManagers\Wiki\Video;
|
||||
|
||||
use App\Filament\RelationManagers\BaseRelationManager;
|
||||
use App\Filament\Resources\Wiki\Video\Script as ScriptResource;
|
||||
use App\Models\Wiki\Video\VideoScript;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Tables\Table;
|
||||
|
||||
/**
|
||||
* Class ScriptRelationManager.
|
||||
*/
|
||||
abstract class ScriptRelationManager extends BaseRelationManager
|
||||
{
|
||||
/**
|
||||
* The form to the actions.
|
||||
*
|
||||
* @param Form $form
|
||||
* @return Form
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public function form(Form $form): Form
|
||||
{
|
||||
return ScriptResource::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(ScriptResource::getPluralLabel())
|
||||
->modelLabel(ScriptResource::getLabel())
|
||||
->recordTitleAttribute(VideoScript::ATTRIBUTE_PATH)
|
||||
->columns(ScriptResource::table($table)->getColumns())
|
||||
->defaultSort(VideoScript::TABLE . '.' . VideoScript::ATTRIBUTE_ID, 'desc')
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the filters available for the relation.
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public static function getFilters(): array
|
||||
{
|
||||
return array_merge(
|
||||
[],
|
||||
ScriptResource::getFilters(),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the actions available for the relation.
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public static function getActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getActions(),
|
||||
ScriptResource::getActions(),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the bulk actions available for the relation.
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public static function getBulkActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getBulkActions(),
|
||||
ScriptResource::getBulkActions(),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the header actions available for the relation.
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public static function getHeaderActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getHeaderActions(),
|
||||
ScriptResource::getHeaderActions(),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,110 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Filament\RelationManagers\Wiki;
|
||||
|
||||
use App\Filament\RelationManagers\BaseRelationManager;
|
||||
use App\Filament\Resources\Wiki\Video as VideoResource;
|
||||
use App\Models\Wiki\Video;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Tables\Table;
|
||||
|
||||
/**
|
||||
* Class VideoRelationManager.
|
||||
*/
|
||||
abstract class VideoRelationManager extends BaseRelationManager
|
||||
{
|
||||
/**
|
||||
* The form to the actions.
|
||||
*
|
||||
* @param Form $form
|
||||
* @return Form
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public function form(Form $form): Form
|
||||
{
|
||||
return VideoResource::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(VideoResource::getPluralLabel())
|
||||
->modelLabel(VideoResource::getLabel())
|
||||
->recordTitleAttribute(Video::ATTRIBUTE_FILENAME)
|
||||
->columns(VideoResource::table($table)->getColumns())
|
||||
->defaultSort(Video::TABLE . '.' . Video::ATTRIBUTE_ID, 'desc')
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the filters available for the relation.
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public static function getFilters(): array
|
||||
{
|
||||
return array_merge(
|
||||
[],
|
||||
VideoResource::getFilters(),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the actions available for the relation.
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public static function getActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getActions(),
|
||||
VideoResource::getActions(),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the bulk actions available for the relation.
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public static function getBulkActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getBulkActions(),
|
||||
VideoResource::getBulkActions(),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the header actions available for the relation.
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public static function getHeaderActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getHeaderActions(),
|
||||
VideoResource::getHeaderActions(),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -141,6 +141,7 @@ class Permission extends BaseResource
|
||||
public static function table(Table $table): Table
|
||||
{
|
||||
return parent::table($table)
|
||||
->recordUrl(fn (PermissionModel $record): string => static::getUrl('view', ['record' => $record]))
|
||||
->columns([
|
||||
TextColumn::make(PermissionModel::ATTRIBUTE_ID)
|
||||
->label(__('filament.fields.base.id'))
|
||||
|
||||
+11
-28
@@ -4,18 +4,15 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Filament\Resources\Auth\Permission\RelationManagers;
|
||||
|
||||
use App\Filament\Resources\BaseRelationManager;
|
||||
use App\Filament\Resources\Auth\Role as RoleResource;
|
||||
use App\Filament\RelationManagers\Auth\RoleRelationManager;
|
||||
use App\Models\Auth\Permission;
|
||||
use App\Models\Auth\Role;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Tables\Actions\ViewAction;
|
||||
use Filament\Tables\Table;
|
||||
|
||||
/**
|
||||
* Class RolePermissionRelationManager.
|
||||
*/
|
||||
class RolePermissionRelationManager extends BaseRelationManager
|
||||
class RolePermissionRelationManager extends RoleRelationManager
|
||||
{
|
||||
/**
|
||||
* The relationship the relation manager corresponds to.
|
||||
@@ -24,19 +21,6 @@ class RolePermissionRelationManager extends BaseRelationManager
|
||||
*/
|
||||
protected static string $relationship = Permission::RELATION_ROLES;
|
||||
|
||||
/**
|
||||
* The form to the actions.
|
||||
*
|
||||
* @param Form $form
|
||||
* @return Form
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public function form(Form $form): Form
|
||||
{
|
||||
return RoleResource::form($form);
|
||||
}
|
||||
|
||||
/**
|
||||
* The index page of the resource.
|
||||
*
|
||||
@@ -49,12 +33,7 @@ class RolePermissionRelationManager extends BaseRelationManager
|
||||
{
|
||||
return parent::table(
|
||||
$table
|
||||
->heading(RoleResource::getPluralLabel())
|
||||
->modelLabel(RoleResource::getLabel())
|
||||
->recordTitleAttribute(Role::ATTRIBUTE_NAME)
|
||||
->inverseRelationship(Role::RELATION_PERMISSIONS)
|
||||
->columns(RoleResource::table($table)->getColumns())
|
||||
->defaultSort(Role::TABLE . '.' . Role::ATTRIBUTE_ID, 'desc')
|
||||
);
|
||||
}
|
||||
|
||||
@@ -67,7 +46,10 @@ class RolePermissionRelationManager extends BaseRelationManager
|
||||
*/
|
||||
public static function getFilters(): array
|
||||
{
|
||||
return [];
|
||||
return array_merge(
|
||||
[],
|
||||
parent::getFilters(),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -79,14 +61,15 @@ class RolePermissionRelationManager extends BaseRelationManager
|
||||
*/
|
||||
public static function getActions(): array
|
||||
{
|
||||
return [
|
||||
ViewAction::make(),
|
||||
];
|
||||
return array_merge(
|
||||
parent::getActions(),
|
||||
[],
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the bulk actions available for the relation.
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
|
||||
+10
-27
@@ -4,18 +4,15 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Filament\Resources\Auth\Permission\RelationManagers;
|
||||
|
||||
use App\Filament\Resources\BaseRelationManager;
|
||||
use App\Filament\Resources\Auth\User as UserResource;
|
||||
use App\Filament\RelationManagers\Auth\UserRelationManager;
|
||||
use App\Models\Auth\Permission;
|
||||
use App\Models\Auth\User;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Tables\Actions\ViewAction;
|
||||
use Filament\Tables\Table;
|
||||
|
||||
/**
|
||||
* Class UserPermissionRelationManager.
|
||||
*/
|
||||
class UserPermissionRelationManager extends BaseRelationManager
|
||||
class UserPermissionRelationManager extends UserRelationManager
|
||||
{
|
||||
/**
|
||||
* The relationship the relation manager corresponds to.
|
||||
@@ -24,19 +21,6 @@ class UserPermissionRelationManager extends BaseRelationManager
|
||||
*/
|
||||
protected static string $relationship = Permission::RELATION_USERS;
|
||||
|
||||
/**
|
||||
* The form to the actions.
|
||||
*
|
||||
* @param Form $form
|
||||
* @return Form
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public function form(Form $form): Form
|
||||
{
|
||||
return UserResource::form($form);
|
||||
}
|
||||
|
||||
/**
|
||||
* The index page of the resource.
|
||||
*
|
||||
@@ -49,12 +33,7 @@ class UserPermissionRelationManager extends BaseRelationManager
|
||||
{
|
||||
return parent::table(
|
||||
$table
|
||||
->heading(UserResource::getPluralLabel())
|
||||
->modelLabel(UserResource::getLabel())
|
||||
->recordTitleAttribute(User::ATTRIBUTE_NAME)
|
||||
->inverseRelationship(User::RELATION_PERMISSIONS)
|
||||
->columns(UserResource::table($table)->getColumns())
|
||||
->defaultSort(User::TABLE . '.' . User::ATTRIBUTE_ID, 'desc')
|
||||
);
|
||||
}
|
||||
|
||||
@@ -67,7 +46,10 @@ class UserPermissionRelationManager extends BaseRelationManager
|
||||
*/
|
||||
public static function getFilters(): array
|
||||
{
|
||||
return [];
|
||||
return array_merge(
|
||||
[],
|
||||
parent::getFilters(),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -79,9 +61,10 @@ class UserPermissionRelationManager extends BaseRelationManager
|
||||
*/
|
||||
public static function getActions(): array
|
||||
{
|
||||
return [
|
||||
ViewAction::make(),
|
||||
];
|
||||
return array_merge(
|
||||
parent::getActions(),
|
||||
[],
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -268,8 +268,7 @@ class Role extends BaseResource
|
||||
->checkbox(),
|
||||
|
||||
NumberFilter::make(RoleModel::ATTRIBUTE_PRIORITY)
|
||||
->labels(__('filament.filters.role.priority_from'), __('filament.filters.role.priority_to'))
|
||||
->attribute(RoleModel::ATTRIBUTE_PRIORITY),
|
||||
->labels(__('filament.filters.role.priority_from'), __('filament.filters.role.priority_to')),
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
+11
-30
@@ -4,19 +4,15 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Filament\Resources\Auth\Role\RelationManagers;
|
||||
|
||||
use App\Filament\Resources\BaseRelationManager;
|
||||
use App\Filament\Resources\Auth\Permission as PermissionResource;
|
||||
use App\Filament\RelationManagers\Auth\PermissionRelationManager;
|
||||
use App\Models\Auth\Role;
|
||||
use App\Models\Auth\Permission;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Tables\Actions\EditAction;
|
||||
use Filament\Tables\Actions\ViewAction;
|
||||
use Filament\Tables\Table;
|
||||
|
||||
/**
|
||||
* Class PermissionRoleRelationManager.
|
||||
*/
|
||||
class PermissionRoleRelationManager extends BaseRelationManager
|
||||
class PermissionRoleRelationManager extends PermissionRelationManager
|
||||
{
|
||||
/**
|
||||
* The relationship the relation manager corresponds to.
|
||||
@@ -25,19 +21,6 @@ class PermissionRoleRelationManager extends BaseRelationManager
|
||||
*/
|
||||
protected static string $relationship = Role::RELATION_PERMISSIONS;
|
||||
|
||||
/**
|
||||
* The form to the actions.
|
||||
*
|
||||
* @param Form $form
|
||||
* @return Form
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public function form(Form $form): Form
|
||||
{
|
||||
return PermissionResource::form($form);
|
||||
}
|
||||
|
||||
/**
|
||||
* The index page of the resource.
|
||||
*
|
||||
@@ -50,12 +33,7 @@ class PermissionRoleRelationManager extends BaseRelationManager
|
||||
{
|
||||
return parent::table(
|
||||
$table
|
||||
->heading(PermissionResource::getPluralLabel())
|
||||
->modelLabel(PermissionResource::getLabel())
|
||||
->recordTitleAttribute(Permission::ATTRIBUTE_NAME)
|
||||
->inverseRelationship(Permission::RELATION_ROLES)
|
||||
->columns(PermissionResource::table($table)->getColumns())
|
||||
->defaultSort(Permission::TABLE . '.' . Permission::ATTRIBUTE_ID, 'desc')
|
||||
);
|
||||
}
|
||||
|
||||
@@ -68,7 +46,10 @@ class PermissionRoleRelationManager extends BaseRelationManager
|
||||
*/
|
||||
public static function getFilters(): array
|
||||
{
|
||||
return [];
|
||||
return array_merge(
|
||||
[],
|
||||
parent::getFilters(),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -80,15 +61,15 @@ class PermissionRoleRelationManager extends BaseRelationManager
|
||||
*/
|
||||
public static function getActions(): array
|
||||
{
|
||||
return [
|
||||
ViewAction::make(),
|
||||
EditAction::make(),
|
||||
];
|
||||
return array_merge(
|
||||
parent::getActions(),
|
||||
[],
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the bulk actions available for the relation.
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
|
||||
@@ -4,11 +4,9 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Filament\Resources\Auth\Role\RelationManagers;
|
||||
|
||||
use App\Filament\Resources\BaseRelationManager;
|
||||
use App\Filament\Resources\Auth\User as UserResource;
|
||||
use App\Filament\RelationManagers\Auth\UserRelationManager;
|
||||
use App\Models\Auth\Role;
|
||||
use App\Models\Auth\User;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Tables\Actions\EditAction;
|
||||
use Filament\Tables\Actions\ViewAction;
|
||||
use Filament\Tables\Table;
|
||||
@@ -16,7 +14,7 @@ use Filament\Tables\Table;
|
||||
/**
|
||||
* Class UserRoleRelationManager.
|
||||
*/
|
||||
class UserRoleRelationManager extends BaseRelationManager
|
||||
class UserRoleRelationManager extends UserRelationManager
|
||||
{
|
||||
/**
|
||||
* The relationship the relation manager corresponds to.
|
||||
@@ -25,19 +23,6 @@ class UserRoleRelationManager extends BaseRelationManager
|
||||
*/
|
||||
protected static string $relationship = Role::RELATION_USERS;
|
||||
|
||||
/**
|
||||
* The form to the actions.
|
||||
*
|
||||
* @param Form $form
|
||||
* @return Form
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public function form(Form $form): Form
|
||||
{
|
||||
return UserResource::form($form);
|
||||
}
|
||||
|
||||
/**
|
||||
* The index page of the resource.
|
||||
*
|
||||
@@ -50,12 +35,7 @@ class UserRoleRelationManager extends BaseRelationManager
|
||||
{
|
||||
return parent::table(
|
||||
$table
|
||||
->heading(UserResource::getPluralLabel())
|
||||
->modelLabel(UserResource::getLabel())
|
||||
->recordTitleAttribute(User::ATTRIBUTE_NAME)
|
||||
->inverseRelationship(User::RELATION_ROLES)
|
||||
->columns(UserResource::table($table)->getColumns())
|
||||
->defaultSort(User::TABLE . '.' . User::ATTRIBUTE_ID, 'desc')
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
+11
-30
@@ -4,19 +4,15 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Filament\Resources\Auth\User\RelationManagers;
|
||||
|
||||
use App\Filament\Resources\BaseRelationManager;
|
||||
use App\Filament\Resources\Auth\Permission as PermissionResource;
|
||||
use App\Filament\RelationManagers\Auth\PermissionRelationManager;
|
||||
use App\Models\Auth\User;
|
||||
use App\Models\Auth\Permission;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Tables\Actions\EditAction;
|
||||
use Filament\Tables\Actions\ViewAction;
|
||||
use Filament\Tables\Table;
|
||||
|
||||
/**
|
||||
* Class PermissionUserRelationManager.
|
||||
*/
|
||||
class PermissionUserRelationManager extends BaseRelationManager
|
||||
class PermissionUserRelationManager extends PermissionRelationManager
|
||||
{
|
||||
/**
|
||||
* The relationship the relation manager corresponds to.
|
||||
@@ -25,19 +21,6 @@ class PermissionUserRelationManager extends BaseRelationManager
|
||||
*/
|
||||
protected static string $relationship = User::RELATION_PERMISSIONS;
|
||||
|
||||
/**
|
||||
* The form to the actions.
|
||||
*
|
||||
* @param Form $form
|
||||
* @return Form
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public function form(Form $form): Form
|
||||
{
|
||||
return PermissionResource::form($form);
|
||||
}
|
||||
|
||||
/**
|
||||
* The index page of the resource.
|
||||
*
|
||||
@@ -50,12 +33,7 @@ class PermissionUserRelationManager extends BaseRelationManager
|
||||
{
|
||||
return parent::table(
|
||||
$table
|
||||
->heading(PermissionResource::getPluralLabel())
|
||||
->modelLabel(PermissionResource::getLabel())
|
||||
->recordTitleAttribute(Permission::ATTRIBUTE_NAME)
|
||||
->inverseRelationship(Permission::RELATION_USERS)
|
||||
->columns(PermissionResource::table($table)->getColumns())
|
||||
->defaultSort(Permission::TABLE . '.' . Permission::ATTRIBUTE_ID, 'desc')
|
||||
);
|
||||
}
|
||||
|
||||
@@ -68,7 +46,10 @@ class PermissionUserRelationManager extends BaseRelationManager
|
||||
*/
|
||||
public static function getFilters(): array
|
||||
{
|
||||
return [];
|
||||
return array_merge(
|
||||
[],
|
||||
parent::getFilters(),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -80,15 +61,15 @@ class PermissionUserRelationManager extends BaseRelationManager
|
||||
*/
|
||||
public static function getActions(): array
|
||||
{
|
||||
return [
|
||||
ViewAction::make(),
|
||||
EditAction::make(),
|
||||
];
|
||||
return array_merge(
|
||||
parent::getActions(),
|
||||
[],
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the bulk actions available for the relation.
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
|
||||
@@ -4,17 +4,15 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Filament\Resources\Auth\User\RelationManagers;
|
||||
|
||||
use App\Filament\Resources\BaseRelationManager;
|
||||
use App\Filament\Resources\List\Playlist as PlaylistResource;
|
||||
use App\Filament\RelationManagers\List\PlaylistRelationManager;
|
||||
use App\Models\Auth\User;
|
||||
use App\Models\List\Playlist;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Tables\Table;
|
||||
|
||||
/**
|
||||
* Class PlaylistUserRelationManager.
|
||||
*/
|
||||
class PlaylistUserRelationManager extends BaseRelationManager
|
||||
class PlaylistUserRelationManager extends PlaylistRelationManager
|
||||
{
|
||||
/**
|
||||
* The relationship the relation manager corresponds to.
|
||||
@@ -23,19 +21,6 @@ class PlaylistUserRelationManager extends BaseRelationManager
|
||||
*/
|
||||
protected static string $relationship = User::RELATION_PLAYLISTS;
|
||||
|
||||
/**
|
||||
* The form to the actions.
|
||||
*
|
||||
* @param Form $form
|
||||
* @return Form
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public function form(Form $form): Form
|
||||
{
|
||||
return PlaylistResource::form($form);
|
||||
}
|
||||
|
||||
/**
|
||||
* The index page of the resource.
|
||||
*
|
||||
@@ -48,12 +33,7 @@ class PlaylistUserRelationManager extends BaseRelationManager
|
||||
{
|
||||
return parent::table(
|
||||
$table
|
||||
->heading(PlaylistResource::getPluralLabel())
|
||||
->modelLabel(PlaylistResource::getLabel())
|
||||
->recordTitleAttribute(Playlist::ATTRIBUTE_NAME)
|
||||
->inverseRelationship(Playlist::RELATION_USER)
|
||||
->columns(PlaylistResource::table($table)->getColumns())
|
||||
->defaultSort(Playlist::TABLE . '.' . Playlist::ATTRIBUTE_ID, 'desc')
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -4,19 +4,16 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Filament\Resources\Auth\User\RelationManagers;
|
||||
|
||||
use App\Filament\Resources\BaseRelationManager;
|
||||
use App\Filament\Resources\Auth\Role as RoleResource;
|
||||
use App\Filament\RelationManagers\Auth\RoleRelationManager;
|
||||
use App\Models\Auth\User;
|
||||
use App\Models\Auth\Role;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Tables\Actions\EditAction;
|
||||
use Filament\Tables\Actions\ViewAction;
|
||||
use Filament\Tables\Table;
|
||||
|
||||
/**
|
||||
* Class RoleUserRelationManager.
|
||||
*/
|
||||
class RoleUserRelationManager extends BaseRelationManager
|
||||
class RoleUserRelationManager extends RoleRelationManager
|
||||
{
|
||||
/**
|
||||
* The relationship the relation manager corresponds to.
|
||||
@@ -25,19 +22,6 @@ class RoleUserRelationManager extends BaseRelationManager
|
||||
*/
|
||||
protected static string $relationship = User::RELATION_ROLES;
|
||||
|
||||
/**
|
||||
* The form to the actions.
|
||||
*
|
||||
* @param Form $form
|
||||
* @return Form
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public function form(Form $form): Form
|
||||
{
|
||||
return RoleResource::form($form);
|
||||
}
|
||||
|
||||
/**
|
||||
* The index page of the resource.
|
||||
*
|
||||
@@ -50,12 +34,7 @@ class RoleUserRelationManager extends BaseRelationManager
|
||||
{
|
||||
return parent::table(
|
||||
$table
|
||||
->heading(RoleResource::getPluralLabel())
|
||||
->modelLabel(RoleResource::getLabel())
|
||||
->recordTitleAttribute(Role::ATTRIBUTE_NAME)
|
||||
->inverseRelationship(Role::RELATION_USERS)
|
||||
->columns(RoleResource::table($table)->getColumns())
|
||||
->defaultSort(Role::TABLE . '.' . Role::ATTRIBUTE_ID, 'desc')
|
||||
);
|
||||
}
|
||||
|
||||
@@ -68,7 +47,10 @@ class RoleUserRelationManager extends BaseRelationManager
|
||||
*/
|
||||
public static function getFilters(): array
|
||||
{
|
||||
return [];
|
||||
return array_merge(
|
||||
[],
|
||||
parent::getFilters(),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -80,15 +62,17 @@ class RoleUserRelationManager extends BaseRelationManager
|
||||
*/
|
||||
public static function getActions(): array
|
||||
{
|
||||
return [
|
||||
ViewAction::make(),
|
||||
EditAction::make(),
|
||||
];
|
||||
return array_merge(
|
||||
parent::getActions(),
|
||||
[
|
||||
EditAction::make(),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the bulk actions available for the relation.
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
|
||||
@@ -5,6 +5,7 @@ declare(strict_types=1);
|
||||
namespace App\Filament\Resources;
|
||||
|
||||
use App\Filament\Components\Filters\DateFilter;
|
||||
use App\Filament\RelationManagers\BaseRelationManager;
|
||||
use App\Models\BaseModel;
|
||||
use Filament\Infolists\Components\TextEntry;
|
||||
use Filament\Resources\Resource;
|
||||
@@ -12,6 +13,7 @@ use Filament\Tables\Actions\ActionGroup;
|
||||
use Filament\Tables\Actions\BulkActionGroup;
|
||||
use Filament\Tables\Actions\DeleteAction;
|
||||
use Filament\Tables\Actions\DeleteBulkAction;
|
||||
use Filament\Tables\Actions\DetachAction;
|
||||
use Filament\Tables\Actions\EditAction;
|
||||
use Filament\Tables\Actions\ForceDeleteAction;
|
||||
use Filament\Tables\Actions\ForceDeleteBulkAction;
|
||||
@@ -99,15 +101,12 @@ abstract class BaseResource extends Resource
|
||||
TrashedFilter::make(),
|
||||
|
||||
DateFilter::make(BaseModel::ATTRIBUTE_CREATED_AT)
|
||||
->attribute(BaseModel::ATTRIBUTE_CREATED_AT)
|
||||
->labels(__('filament.filters.base.created_at_from'), __('filament.filters.base.created_at_to')),
|
||||
|
||||
DateFilter::make(BaseModel::ATTRIBUTE_UPDATED_AT)
|
||||
->attribute(BaseModel::ATTRIBUTE_UPDATED_AT)
|
||||
->labels(__('filament.filters.base.updated_at_from'), __('filament.filters.base.updated_at_to')),
|
||||
|
||||
DateFilter::make(BaseModel::ATTRIBUTE_DELETED_AT)
|
||||
->attribute(BaseModel::ATTRIBUTE_DELETED_AT)
|
||||
->labels(__('filament.filters.base.deleted_at_from'), __('filament.filters.base.deleted_at_to')),
|
||||
];
|
||||
}
|
||||
@@ -129,6 +128,10 @@ abstract class BaseResource extends Resource
|
||||
->label(__('filament.actions.base.edit')),
|
||||
|
||||
ActionGroup::make([
|
||||
DetachAction::make()
|
||||
->label(__('filament.actions.base.detach'))
|
||||
->hidden(fn ($livewire) => !($livewire instanceof BaseRelationManager)),
|
||||
|
||||
DeleteAction::make()
|
||||
->label(__('filament.actions.base.delete')),
|
||||
|
||||
|
||||
+5
-25
@@ -4,17 +4,15 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Filament\Resources\List\Playlist\RelationManagers;
|
||||
|
||||
use App\Filament\Resources\BaseRelationManager;
|
||||
use App\Filament\Resources\Wiki\Image as ImageResource;
|
||||
use App\Filament\RelationManagers\Wiki\ImageRelationManager;
|
||||
use App\Models\List\Playlist;
|
||||
use App\Models\Wiki\Image;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Tables\Table;
|
||||
|
||||
/**
|
||||
* Class ImagePlaylistRelationManager.
|
||||
*/
|
||||
class ImagePlaylistRelationManager extends BaseRelationManager
|
||||
class ImagePlaylistRelationManager extends ImageRelationManager
|
||||
{
|
||||
/**
|
||||
* The relationship the relation manager corresponds to.
|
||||
@@ -23,19 +21,6 @@ class ImagePlaylistRelationManager extends BaseRelationManager
|
||||
*/
|
||||
protected static string $relationship = Playlist::RELATION_IMAGES;
|
||||
|
||||
/**
|
||||
* The form to the actions.
|
||||
*
|
||||
* @param Form $form
|
||||
* @return Form
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public function form(Form $form): Form
|
||||
{
|
||||
return ImageResource::form($form);
|
||||
}
|
||||
|
||||
/**
|
||||
* The index page of the resource.
|
||||
*
|
||||
@@ -48,12 +33,7 @@ class ImagePlaylistRelationManager extends BaseRelationManager
|
||||
{
|
||||
return parent::table(
|
||||
$table
|
||||
->heading(ImageResource::getPluralLabel())
|
||||
->modelLabel(ImageResource::getLabel())
|
||||
->recordTitleAttribute(Image::ATTRIBUTE_PATH)
|
||||
->inverseRelationship(Image::RELATION_PLAYLISTS)
|
||||
->columns(ImageResource::table($table)->getColumns())
|
||||
->defaultSort(Image::TABLE.'.'.Image::ATTRIBUTE_ID, 'desc')
|
||||
->inverseRelationship(Image::RELATION_PLAYLISTS)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -67,8 +47,8 @@ class ImagePlaylistRelationManager extends BaseRelationManager
|
||||
public static function getFilters(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getFilters(),
|
||||
[],
|
||||
parent::getFilters(),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -89,7 +69,7 @@ class ImagePlaylistRelationManager extends BaseRelationManager
|
||||
|
||||
/**
|
||||
* Get the bulk actions available for the relation.
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
|
||||
+4
-24
@@ -4,17 +4,15 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Filament\Resources\List\Playlist\RelationManagers;
|
||||
|
||||
use App\Filament\Resources\BaseRelationManager;
|
||||
use App\Filament\Resources\List\Playlist\Track as TrackResource;
|
||||
use App\Filament\RelationManagers\List\Playlist\TrackRelationManager;
|
||||
use App\Models\List\Playlist;
|
||||
use App\Models\List\Playlist\PlaylistTrack;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Tables\Table;
|
||||
|
||||
/**
|
||||
* Class TrackPlaylistRelationManager.
|
||||
*/
|
||||
class TrackPlaylistRelationManager extends BaseRelationManager
|
||||
class TrackPlaylistRelationManager extends TrackRelationManager
|
||||
{
|
||||
/**
|
||||
* The relationship the relation manager corresponds to.
|
||||
@@ -23,19 +21,6 @@ class TrackPlaylistRelationManager extends BaseRelationManager
|
||||
*/
|
||||
protected static string $relationship = Playlist::RELATION_TRACKS;
|
||||
|
||||
/**
|
||||
* The form to the actions.
|
||||
*
|
||||
* @param Form $form
|
||||
* @return Form
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public function form(Form $form): Form
|
||||
{
|
||||
return TrackResource::form($form);
|
||||
}
|
||||
|
||||
/**
|
||||
* The index page of the resource.
|
||||
*
|
||||
@@ -48,12 +33,7 @@ class TrackPlaylistRelationManager extends BaseRelationManager
|
||||
{
|
||||
return parent::table(
|
||||
$table
|
||||
->heading(TrackResource::getPluralLabel())
|
||||
->modelLabel(TrackResource::getLabel())
|
||||
->recordTitleAttribute(PlaylistTrack::ATTRIBUTE_HASHID)
|
||||
->inverseRelationship(PlaylistTrack::RELATION_PLAYLIST)
|
||||
->columns(TrackResource::table($table)->getColumns())
|
||||
->defaultSort(PlaylistTrack::TABLE . '.' . PlaylistTrack::ATTRIBUTE_ID, 'desc')
|
||||
);
|
||||
}
|
||||
|
||||
@@ -67,8 +47,8 @@ class TrackPlaylistRelationManager extends BaseRelationManager
|
||||
public static function getFilters(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getFilters(),
|
||||
[],
|
||||
parent::getFilters(),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -89,7 +69,7 @@ class TrackPlaylistRelationManager extends BaseRelationManager
|
||||
|
||||
/**
|
||||
* Get the bulk actions available for the relation.
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
|
||||
@@ -380,8 +380,7 @@ class Anime extends BaseResource
|
||||
return array_merge(
|
||||
[
|
||||
NumberFilter::make(AnimeModel::ATTRIBUTE_YEAR)
|
||||
->labels(__('filament.filters.anime.year_from'), __('filament.filters.anime.year_to'))
|
||||
->attribute(AnimeModel::ATTRIBUTE_YEAR),
|
||||
->labels(__('filament.filters.anime.year_from'), __('filament.filters.anime.year_to')),
|
||||
|
||||
SelectFilter::make(AnimeModel::ATTRIBUTE_SEASON)
|
||||
->label(__('filament.fields.anime.season.name'))
|
||||
|
||||
@@ -4,17 +4,15 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Filament\Resources\Wiki\Anime\RelationManagers;
|
||||
|
||||
use App\Filament\Resources\BaseRelationManager;
|
||||
use App\Filament\Resources\Wiki\Image as ImageResource;
|
||||
use App\Filament\RelationManagers\Wiki\ImageRelationManager;
|
||||
use App\Models\Wiki\Anime;
|
||||
use App\Models\Wiki\Image;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Tables\Table;
|
||||
|
||||
/**
|
||||
* Class ImageAnimeRelationManager.
|
||||
*/
|
||||
class ImageAnimeRelationManager extends BaseRelationManager
|
||||
class ImageAnimeRelationManager extends ImageRelationManager
|
||||
{
|
||||
/**
|
||||
* The relationship the relation manager corresponds to.
|
||||
@@ -23,19 +21,6 @@ class ImageAnimeRelationManager extends BaseRelationManager
|
||||
*/
|
||||
protected static string $relationship = Anime::RELATION_IMAGES;
|
||||
|
||||
/**
|
||||
* The form to the actions.
|
||||
*
|
||||
* @param Form $form
|
||||
* @return Form
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public function form(Form $form): Form
|
||||
{
|
||||
return ImageResource::form($form);
|
||||
}
|
||||
|
||||
/**
|
||||
* The index page of the resource.
|
||||
*
|
||||
@@ -48,12 +33,7 @@ class ImageAnimeRelationManager extends BaseRelationManager
|
||||
{
|
||||
return parent::table(
|
||||
$table
|
||||
->heading(ImageResource::getPluralLabel())
|
||||
->modelLabel(ImageResource::getLabel())
|
||||
->recordTitleAttribute(Image::ATTRIBUTE_PATH)
|
||||
->inverseRelationship(Image::RELATION_ANIME)
|
||||
->columns(ImageResource::table($table)->getColumns())
|
||||
->defaultSort(Image::TABLE . '.' . Image::ATTRIBUTE_ID, 'desc')
|
||||
);
|
||||
}
|
||||
|
||||
@@ -67,8 +47,8 @@ class ImageAnimeRelationManager extends BaseRelationManager
|
||||
public static function getFilters(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getFilters(),
|
||||
[],
|
||||
parent::getFilters(),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -89,7 +69,7 @@ class ImageAnimeRelationManager extends BaseRelationManager
|
||||
|
||||
/**
|
||||
* Get the bulk actions available for the relation.
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
|
||||
+4
-24
@@ -4,17 +4,15 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Filament\Resources\Wiki\Anime\RelationManagers;
|
||||
|
||||
use App\Filament\Resources\BaseRelationManager;
|
||||
use App\Filament\Resources\Wiki\ExternalResource as ExternalResourceResource;
|
||||
use App\Filament\RelationManagers\Wiki\ResourceRelationManager;
|
||||
use App\Models\Wiki\Anime;
|
||||
use App\Models\Wiki\ExternalResource;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Tables\Table;
|
||||
|
||||
/**
|
||||
* Class ResourceAnimeRelationManager.
|
||||
*/
|
||||
class ResourceAnimeRelationManager extends BaseRelationManager
|
||||
class ResourceAnimeRelationManager extends ResourceRelationManager
|
||||
{
|
||||
/**
|
||||
* The relationship the relation manager corresponds to.
|
||||
@@ -23,19 +21,6 @@ class ResourceAnimeRelationManager extends BaseRelationManager
|
||||
*/
|
||||
protected static string $relationship = Anime::RELATION_RESOURCES;
|
||||
|
||||
/**
|
||||
* The form to the actions.
|
||||
*
|
||||
* @param Form $form
|
||||
* @return Form
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public function form(Form $form): Form
|
||||
{
|
||||
return ExternalResourceResource::form($form);
|
||||
}
|
||||
|
||||
/**
|
||||
* The index page of the resource.
|
||||
*
|
||||
@@ -48,12 +33,7 @@ class ResourceAnimeRelationManager extends BaseRelationManager
|
||||
{
|
||||
return parent::table(
|
||||
$table
|
||||
->heading(ExternalResourceResource::getPluralLabel())
|
||||
->modelLabel(ExternalResourceResource::getLabel())
|
||||
->recordTitleAttribute(ExternalResource::ATTRIBUTE_LINK)
|
||||
->inverseRelationship(ExternalResource::RELATION_ANIME)
|
||||
->columns(ExternalResourceResource::table($table)->getColumns())
|
||||
->defaultSort(ExternalResource::TABLE . '.' . ExternalResource::ATTRIBUTE_ID, 'desc')
|
||||
);
|
||||
}
|
||||
|
||||
@@ -67,8 +47,8 @@ class ResourceAnimeRelationManager extends BaseRelationManager
|
||||
public static function getFilters(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getFilters(),
|
||||
[],
|
||||
parent::getFilters(),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -89,7 +69,7 @@ class ResourceAnimeRelationManager extends BaseRelationManager
|
||||
|
||||
/**
|
||||
* Get the bulk actions available for the relation.
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
|
||||
@@ -4,17 +4,15 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Filament\Resources\Wiki\Anime\RelationManagers;
|
||||
|
||||
use App\Filament\Resources\BaseRelationManager;
|
||||
use App\Filament\Resources\Wiki\Series as SeriesResource;
|
||||
use App\Filament\RelationManagers\Wiki\SeriesRelationManager;
|
||||
use App\Models\Wiki\Anime;
|
||||
use App\Models\Wiki\Series;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Tables\Table;
|
||||
|
||||
/**
|
||||
* Class SeriesAnimeRelationManager.
|
||||
*/
|
||||
class SeriesAnimeRelationManager extends BaseRelationManager
|
||||
class SeriesAnimeRelationManager extends SeriesRelationManager
|
||||
{
|
||||
/**
|
||||
* The relationship the relation manager corresponds to.
|
||||
@@ -23,19 +21,6 @@ class SeriesAnimeRelationManager extends BaseRelationManager
|
||||
*/
|
||||
protected static string $relationship = Anime::RELATION_SERIES;
|
||||
|
||||
/**
|
||||
* The form to the actions.
|
||||
*
|
||||
* @param Form $form
|
||||
* @return Form
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public function form(Form $form): Form
|
||||
{
|
||||
return SeriesResource::form($form);
|
||||
}
|
||||
|
||||
/**
|
||||
* The index page of the resource.
|
||||
*
|
||||
@@ -48,12 +33,7 @@ class SeriesAnimeRelationManager extends BaseRelationManager
|
||||
{
|
||||
return parent::table(
|
||||
$table
|
||||
->heading(SeriesResource::getPluralLabel())
|
||||
->modelLabel(SeriesResource::getLabel())
|
||||
->recordTitleAttribute(Series::ATTRIBUTE_NAME)
|
||||
->inverseRelationship(Series::RELATION_ANIME)
|
||||
->columns(SeriesResource::table($table)->getColumns())
|
||||
->defaultSort(Series::TABLE . '.' . Series::ATTRIBUTE_ID, 'desc')
|
||||
);
|
||||
}
|
||||
|
||||
@@ -67,8 +47,8 @@ class SeriesAnimeRelationManager extends BaseRelationManager
|
||||
public static function getFilters(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getFilters(),
|
||||
[],
|
||||
parent::getFilters(),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -89,7 +69,7 @@ class SeriesAnimeRelationManager extends BaseRelationManager
|
||||
|
||||
/**
|
||||
* Get the bulk actions available for the relation.
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
|
||||
@@ -4,17 +4,15 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Filament\Resources\Wiki\Anime\RelationManagers;
|
||||
|
||||
use App\Filament\Resources\BaseRelationManager;
|
||||
use App\Filament\Resources\Wiki\Studio as StudioResource;
|
||||
use App\Filament\RelationManagers\Wiki\StudioRelationManager;
|
||||
use App\Models\Wiki\Anime;
|
||||
use App\Models\Wiki\Studio;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Tables\Table;
|
||||
|
||||
/**
|
||||
* Class StudioAnimeRelationManager.
|
||||
*/
|
||||
class StudioAnimeRelationManager extends BaseRelationManager
|
||||
class StudioAnimeRelationManager extends StudioRelationManager
|
||||
{
|
||||
/**
|
||||
* The relationship the relation manager corresponds to.
|
||||
@@ -23,19 +21,6 @@ class StudioAnimeRelationManager extends BaseRelationManager
|
||||
*/
|
||||
protected static string $relationship = Anime::RELATION_STUDIOS;
|
||||
|
||||
/**
|
||||
* The form to the actions.
|
||||
*
|
||||
* @param Form $form
|
||||
* @return Form
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public function form(Form $form): Form
|
||||
{
|
||||
return StudioResource::form($form);
|
||||
}
|
||||
|
||||
/**
|
||||
* The index page of the resource.
|
||||
*
|
||||
@@ -48,12 +33,7 @@ class StudioAnimeRelationManager extends BaseRelationManager
|
||||
{
|
||||
return parent::table(
|
||||
$table
|
||||
->heading(StudioResource::getPluralLabel())
|
||||
->modelLabel(StudioResource::getLabel())
|
||||
->recordTitleAttribute(Studio::ATTRIBUTE_NAME)
|
||||
->inverseRelationship(Studio::RELATION_ANIME)
|
||||
->columns(StudioResource::table($table)->getColumns())
|
||||
->defaultSort(Studio::TABLE . '.' . Studio::ATTRIBUTE_ID, 'desc')
|
||||
);
|
||||
}
|
||||
|
||||
@@ -67,8 +47,8 @@ class StudioAnimeRelationManager extends BaseRelationManager
|
||||
public static function getFilters(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getFilters(),
|
||||
[],
|
||||
parent::getFilters(),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -89,7 +69,7 @@ class StudioAnimeRelationManager extends BaseRelationManager
|
||||
|
||||
/**
|
||||
* Get the bulk actions available for the relation.
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
|
||||
@@ -4,17 +4,15 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Filament\Resources\Wiki\Anime\RelationManagers;
|
||||
|
||||
use App\Filament\Resources\BaseRelationManager;
|
||||
use App\Filament\Resources\Wiki\Anime\Synonym as Synonym;
|
||||
use App\Filament\RelationManagers\Wiki\Anime\SynonymRelationManager;
|
||||
use App\Models\Wiki\Anime;
|
||||
use App\Models\Wiki\Anime\AnimeSynonym as SynonymModel;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Tables\Table;
|
||||
|
||||
/**
|
||||
* Class SynonymAnimeRelationManager.
|
||||
*/
|
||||
class SynonymAnimeRelationManager extends BaseRelationManager
|
||||
class SynonymAnimeRelationManager extends SynonymRelationManager
|
||||
{
|
||||
/**
|
||||
* The relationship the relation manager corresponds to.
|
||||
@@ -23,19 +21,6 @@ class SynonymAnimeRelationManager extends BaseRelationManager
|
||||
*/
|
||||
protected static string $relationship = Anime::RELATION_SYNONYMS;
|
||||
|
||||
/**
|
||||
* The form to the actions.
|
||||
*
|
||||
* @param Form $form
|
||||
* @return Form
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public function form(Form $form): Form
|
||||
{
|
||||
return Synonym::form($form);
|
||||
}
|
||||
|
||||
/**
|
||||
* The index page of the Synonym.
|
||||
*
|
||||
@@ -48,12 +33,7 @@ class SynonymAnimeRelationManager extends BaseRelationManager
|
||||
{
|
||||
return parent::table(
|
||||
$table
|
||||
->heading(Synonym::getPluralLabel())
|
||||
->modelLabel(Synonym::getLabel())
|
||||
->recordTitleAttribute(SynonymModel::ATTRIBUTE_TEXT)
|
||||
->inverseRelationship(SynonymModel::RELATION_ANIME)
|
||||
->columns(Synonym::table($table)->getColumns())
|
||||
->defaultSort(SynonymModel::TABLE . '.' . SynonymModel::ATTRIBUTE_ID, 'desc')
|
||||
);
|
||||
}
|
||||
|
||||
@@ -67,8 +47,8 @@ class SynonymAnimeRelationManager extends BaseRelationManager
|
||||
public static function getFilters(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getFilters(),
|
||||
[],
|
||||
parent::getFilters(),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -89,7 +69,7 @@ class SynonymAnimeRelationManager extends BaseRelationManager
|
||||
|
||||
/**
|
||||
* Get the bulk actions available for the relation.
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
|
||||
@@ -4,17 +4,15 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Filament\Resources\Wiki\Anime\RelationManagers;
|
||||
|
||||
use App\Filament\Resources\BaseRelationManager;
|
||||
use App\Filament\Resources\Wiki\Anime\Theme as Theme;
|
||||
use App\Filament\RelationManagers\Wiki\Anime\ThemeRelationManager;
|
||||
use App\Models\Wiki\Anime;
|
||||
use App\Models\Wiki\Anime\AnimeTheme as ThemeModel;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Tables\Table;
|
||||
|
||||
/**
|
||||
* Class ThemeAnimeRelationManager.
|
||||
*/
|
||||
class ThemeAnimeRelationManager extends BaseRelationManager
|
||||
class ThemeAnimeRelationManager extends ThemeRelationManager
|
||||
{
|
||||
/**
|
||||
* The relationship the relation manager corresponds to.
|
||||
@@ -23,19 +21,6 @@ class ThemeAnimeRelationManager extends BaseRelationManager
|
||||
*/
|
||||
protected static string $relationship = Anime::RELATION_THEMES;
|
||||
|
||||
/**
|
||||
* The form to the actions.
|
||||
*
|
||||
* @param Form $form
|
||||
* @return Form
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public function form(Form $form): Form
|
||||
{
|
||||
return Theme::form($form);
|
||||
}
|
||||
|
||||
/**
|
||||
* The index page of the Theme.
|
||||
*
|
||||
@@ -48,12 +33,7 @@ class ThemeAnimeRelationManager extends BaseRelationManager
|
||||
{
|
||||
return parent::table(
|
||||
$table
|
||||
->heading(Theme::getPluralLabel())
|
||||
->modelLabel(Theme::getLabel())
|
||||
->recordTitleAttribute(ThemeModel::ATTRIBUTE_SLUG)
|
||||
->inverseRelationship(ThemeModel::RELATION_ANIME)
|
||||
->columns(Theme::table($table)->getColumns())
|
||||
->defaultSort(ThemeModel::TABLE.'.'.ThemeModel::ATTRIBUTE_ID, 'desc')
|
||||
);
|
||||
}
|
||||
|
||||
@@ -67,8 +47,8 @@ class ThemeAnimeRelationManager extends BaseRelationManager
|
||||
public static function getFilters(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getFilters(),
|
||||
[],
|
||||
parent::getFilters(),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -89,7 +69,7 @@ class ThemeAnimeRelationManager extends BaseRelationManager
|
||||
|
||||
/**
|
||||
* Get the bulk actions available for the relation.
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
|
||||
@@ -8,7 +8,7 @@ use App\Enums\Models\Wiki\AnimeSynonymType;
|
||||
use App\Filament\Components\Columns\TextColumn;
|
||||
use App\Filament\Components\Fields\Select;
|
||||
use App\Filament\Components\Infolist\TextEntry;
|
||||
use App\Filament\Resources\BaseRelationManager;
|
||||
use App\Filament\RelationManagers\Wiki\Anime\SynonymRelationManager;
|
||||
use App\Filament\Resources\BaseResource;
|
||||
use App\Filament\Resources\Wiki\Anime as AnimeResource;
|
||||
use App\Filament\Resources\Wiki\Anime\RelationManagers\SynonymAnimeRelationManager;
|
||||
@@ -126,7 +126,7 @@ class Synonym extends BaseResource
|
||||
->label(__('filament.resources.singularLabel.anime'))
|
||||
->relationship(SynonymModel::RELATION_ANIME, AnimeModel::ATTRIBUTE_NAME)
|
||||
->searchable()
|
||||
->hiddenOn(BaseRelationManager::class),
|
||||
->hiddenOn(SynonymRelationManager::class),
|
||||
|
||||
Select::make(SynonymModel::ATTRIBUTE_TYPE)
|
||||
->label(__('filament.fields.anime_synonym.type.name'))
|
||||
|
||||
@@ -9,7 +9,7 @@ use App\Filament\Components\Columns\TextColumn;
|
||||
use App\Filament\Components\Fields\Select;
|
||||
use App\Filament\Components\Filters\NumberFilter;
|
||||
use App\Filament\Components\Infolist\TextEntry;
|
||||
use App\Filament\Resources\BaseRelationManager;
|
||||
use App\Filament\RelationManagers\Wiki\Anime\ThemeRelationManager;
|
||||
use App\Filament\Resources\BaseResource;
|
||||
use App\Filament\Resources\Wiki\Anime as AnimeResource;
|
||||
use App\Filament\Resources\Wiki\Anime\RelationManagers\ThemeAnimeRelationManager;
|
||||
@@ -162,7 +162,7 @@ class Theme extends BaseResource
|
||||
->label(__('filament.resources.singularLabel.anime'))
|
||||
->relationship(ThemeModel::RELATION_ANIME, AnimeModel::ATTRIBUTE_NAME)
|
||||
->searchable()
|
||||
->hiddenOn(BaseRelationManager::class),
|
||||
->hiddenOn(ThemeRelationManager::class),
|
||||
|
||||
Select::make(ThemeModel::ATTRIBUTE_TYPE)
|
||||
->label(__('filament.fields.anime_theme.type.name'))
|
||||
@@ -376,8 +376,7 @@ class Theme extends BaseResource
|
||||
->options(ThemeType::asSelectArray()),
|
||||
|
||||
NumberFilter::make(ThemeModel::ATTRIBUTE_SEQUENCE)
|
||||
->labels(__('filament.filters.anime_theme.sequence_from'), __('filament.filters.anime_theme.sequence_to'))
|
||||
->attribute(ThemeModel::ATTRIBUTE_SEQUENCE),
|
||||
->labels(__('filament.filters.anime_theme.sequence_from'), __('filament.filters.anime_theme.sequence_to')),
|
||||
],
|
||||
parent::getFilters(),
|
||||
);
|
||||
|
||||
@@ -9,7 +9,7 @@ use App\Filament\Components\Fields\Select;
|
||||
use App\Filament\Components\Filters\NumberFilter;
|
||||
use App\Filament\Components\Filters\TextFilter;
|
||||
use App\Filament\Components\Infolist\TextEntry;
|
||||
use App\Filament\Resources\BaseRelationManager;
|
||||
use App\Filament\RelationManagers\Wiki\Anime\Theme\EntryRelationManager;
|
||||
use App\Filament\Resources\BaseResource;
|
||||
use App\Filament\Resources\Wiki\Anime as AnimeResource;
|
||||
use App\Filament\Resources\Wiki\Anime\Theme as ThemeResource;
|
||||
@@ -162,9 +162,9 @@ class Entry extends BaseResource
|
||||
->label(__('filament.resources.singularLabel.anime'))
|
||||
->relationship(EntryModel::RELATION_ANIME_SHALLOW, AnimeModel::ATTRIBUTE_NAME)
|
||||
->searchable()
|
||||
->hiddenOn(BaseRelationManager::class)
|
||||
->hiddenOn(EntryRelationManager::class)
|
||||
->formatStateUsing(function ($livewire, $state) {
|
||||
if ($livewire instanceof BaseRelationManager) {
|
||||
if ($livewire instanceof EntryRelationManager) {
|
||||
/** @var EntryModel */
|
||||
$entry = $livewire->getOwnerRecord();
|
||||
return $entry->anime->getName();
|
||||
@@ -177,7 +177,7 @@ class Entry extends BaseResource
|
||||
->label(__('filament.resources.singularLabel.anime_theme'))
|
||||
->relationship(EntryModel::RELATION_THEME, ThemeModel::ATTRIBUTE_ID)
|
||||
->searchable()
|
||||
->hiddenOn(BaseRelationManager::class)
|
||||
->hiddenOn(EntryRelationManager::class)
|
||||
->allowHtml()
|
||||
->getSearchResultsUsing(function ($search) {
|
||||
return ThemeModel::search($search)
|
||||
@@ -360,12 +360,10 @@ class Entry extends BaseResource
|
||||
return array_merge(
|
||||
[
|
||||
NumberFilter::make(EntryModel::ATTRIBUTE_VERSION)
|
||||
->labels(__('filament.filters.anime_theme_entry.version_from'), __('filament.filters.anime_theme_entry.version_to'))
|
||||
->attribute(EntryModel::ATTRIBUTE_VERSION),
|
||||
->labels(__('filament.filters.anime_theme_entry.version_from'), __('filament.filters.anime_theme_entry.version_to')),
|
||||
|
||||
TextFilter::make(EntryModel::ATTRIBUTE_EPISODES)
|
||||
->label(__('filament.fields.anime_theme_entry.episodes.name'))
|
||||
->attribute(EntryModel::ATTRIBUTE_EPISODES),
|
||||
->label(__('filament.fields.anime_theme_entry.episodes.name')),
|
||||
|
||||
Filter::make(EntryModel::ATTRIBUTE_NSFW)
|
||||
->label(__('filament.fields.anime_theme_entry.nsfw.name'))
|
||||
|
||||
+4
-23
@@ -4,17 +4,16 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Filament\Resources\Wiki\Anime\Theme\Entry\RelationManagers;
|
||||
|
||||
use App\Filament\Resources\BaseRelationManager;
|
||||
use App\Filament\RelationManagers\Wiki\VideoRelationManager;
|
||||
use App\Filament\Resources\Wiki\Video as VideoResource;
|
||||
use App\Models\Wiki\Anime\Theme\AnimeThemeEntry;
|
||||
use App\Models\Wiki\Video;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Tables\Table;
|
||||
|
||||
/**
|
||||
* Class VideoEntryRelationManager.
|
||||
*/
|
||||
class VideoEntryRelationManager extends BaseRelationManager
|
||||
class VideoEntryRelationManager extends VideoRelationManager
|
||||
{
|
||||
/**
|
||||
* The relationship the relation manager corresponds to.
|
||||
@@ -23,19 +22,6 @@ class VideoEntryRelationManager extends BaseRelationManager
|
||||
*/
|
||||
protected static string $relationship = AnimeThemeEntry::RELATION_VIDEOS;
|
||||
|
||||
/**
|
||||
* The form to the actions.
|
||||
*
|
||||
* @param Form $form
|
||||
* @return Form
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public function form(Form $form): Form
|
||||
{
|
||||
return VideoResource::form($form);
|
||||
}
|
||||
|
||||
/**
|
||||
* The index page of the resource.
|
||||
*
|
||||
@@ -48,12 +34,7 @@ class VideoEntryRelationManager extends BaseRelationManager
|
||||
{
|
||||
return parent::table(
|
||||
$table
|
||||
->heading(VideoResource::getPluralLabel())
|
||||
->modelLabel(VideoResource::getLabel())
|
||||
->recordTitleAttribute(Video::ATTRIBUTE_FILENAME)
|
||||
->inverseRelationship(Video::RELATION_ANIMETHEMEENTRIES)
|
||||
->columns(VideoResource::table($table)->getColumns())
|
||||
->defaultSort(Video::TABLE . '.' . Video::ATTRIBUTE_ID, 'desc')
|
||||
);
|
||||
}
|
||||
|
||||
@@ -67,8 +48,8 @@ class VideoEntryRelationManager extends BaseRelationManager
|
||||
public static function getFilters(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getFilters(),
|
||||
[],
|
||||
parent::getFilters(),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -89,7 +70,7 @@ class VideoEntryRelationManager extends BaseRelationManager
|
||||
|
||||
/**
|
||||
* Get the bulk actions available for the relation.
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
|
||||
+4
-24
@@ -4,17 +4,15 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Filament\Resources\Wiki\Anime\Theme\RelationManagers;
|
||||
|
||||
use App\Filament\Resources\BaseRelationManager;
|
||||
use App\Filament\Resources\Wiki\Anime\Theme\Entry as EntryResource;
|
||||
use App\Filament\RelationManagers\Wiki\Anime\Theme\EntryRelationManager;
|
||||
use App\Models\Wiki\Anime\Theme\AnimeThemeEntry;
|
||||
use App\Models\Wiki\Anime\AnimeTheme;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Tables\Table;
|
||||
|
||||
/**
|
||||
* Class EntryThemeRelationManager.
|
||||
*/
|
||||
class EntryThemeRelationManager extends BaseRelationManager
|
||||
class EntryThemeRelationManager extends EntryRelationManager
|
||||
{
|
||||
/**
|
||||
* The relationship the relation manager corresponds to.
|
||||
@@ -23,19 +21,6 @@ class EntryThemeRelationManager extends BaseRelationManager
|
||||
*/
|
||||
protected static string $relationship = AnimeTheme::RELATION_ENTRIES;
|
||||
|
||||
/**
|
||||
* The form to the actions.
|
||||
*
|
||||
* @param Form $form
|
||||
* @return Form
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public function form(Form $form): Form
|
||||
{
|
||||
return EntryResource::form($form);
|
||||
}
|
||||
|
||||
/**
|
||||
* The index page of the resource.
|
||||
*
|
||||
@@ -48,12 +33,7 @@ class EntryThemeRelationManager extends BaseRelationManager
|
||||
{
|
||||
return parent::table(
|
||||
$table
|
||||
->heading(EntryResource::getPluralLabel())
|
||||
->modelLabel(EntryResource::getLabel())
|
||||
->recordTitleAttribute(AnimeThemeEntry::ATTRIBUTE_VERSION)
|
||||
->inverseRelationship(AnimeThemeEntry::RELATION_THEME)
|
||||
->columns(EntryResource::table($table)->getColumns())
|
||||
->defaultSort(AnimeThemeEntry::TABLE . '.' . AnimeThemeEntry::ATTRIBUTE_ID, 'desc')
|
||||
);
|
||||
}
|
||||
|
||||
@@ -67,8 +47,8 @@ class EntryThemeRelationManager extends BaseRelationManager
|
||||
public static function getFilters(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getFilters(),
|
||||
[],
|
||||
parent::getFilters(),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -89,7 +69,7 @@ class EntryThemeRelationManager extends BaseRelationManager
|
||||
|
||||
/**
|
||||
* Get the bulk actions available for the relation.
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
|
||||
@@ -4,16 +4,14 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Filament\Resources\Wiki\Artist\RelationManagers;
|
||||
|
||||
use App\Filament\Resources\BaseRelationManager;
|
||||
use App\Filament\Resources\Wiki\Artist as ArtistResource;
|
||||
use App\Filament\RelationManagers\Wiki\ArtistRelationManager;
|
||||
use App\Models\Wiki\Artist;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Tables\Table;
|
||||
|
||||
/**
|
||||
* Class GroupArtistRelationManager.
|
||||
*/
|
||||
class GroupArtistRelationManager extends BaseRelationManager
|
||||
class GroupArtistRelationManager extends ArtistRelationManager
|
||||
{
|
||||
/**
|
||||
* The relationship the relation manager corresponds to.
|
||||
@@ -22,19 +20,6 @@ class GroupArtistRelationManager extends BaseRelationManager
|
||||
*/
|
||||
protected static string $relationship = Artist::RELATION_GROUPS;
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
@@ -47,13 +32,10 @@ class GroupArtistRelationManager extends BaseRelationManager
|
||||
{
|
||||
return parent::table(
|
||||
$table
|
||||
->heading(__('filament.resources.label.groups'))
|
||||
->modelLabel(__('filament.resources.singularLabel.group'))
|
||||
->recordTitleAttribute(Artist::ATTRIBUTE_NAME)
|
||||
->inverseRelationship(Artist::RELATION_MEMBERS)
|
||||
->columns(ArtistResource::table($table)->getColumns())
|
||||
->defaultSort(Artist::TABLE . '.' . Artist::ATTRIBUTE_ID, 'desc')
|
||||
);
|
||||
)
|
||||
->heading(__('filament.resources.label.groups'))
|
||||
->modelLabel(__('filament.resources.singularLabel.group'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -4,17 +4,15 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Filament\Resources\Wiki\Artist\RelationManagers;
|
||||
|
||||
use App\Filament\Resources\BaseRelationManager;
|
||||
use App\Filament\Resources\Wiki\Image as ImageResource;
|
||||
use App\Filament\RelationManagers\Wiki\ImageRelationManager;
|
||||
use App\Models\Wiki\Artist;
|
||||
use App\Models\Wiki\Image;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Tables\Table;
|
||||
|
||||
/**
|
||||
* Class ImageArtistRelationManager.
|
||||
*/
|
||||
class ImageArtistRelationManager extends BaseRelationManager
|
||||
class ImageArtistRelationManager extends ImageRelationManager
|
||||
{
|
||||
/**
|
||||
* The relationship the relation manager corresponds to.
|
||||
@@ -23,19 +21,6 @@ class ImageArtistRelationManager extends BaseRelationManager
|
||||
*/
|
||||
protected static string $relationship = Artist::RELATION_IMAGES;
|
||||
|
||||
/**
|
||||
* The form to the actions.
|
||||
*
|
||||
* @param Form $form
|
||||
* @return Form
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public function form(Form $form): Form
|
||||
{
|
||||
return ImageResource::form($form);
|
||||
}
|
||||
|
||||
/**
|
||||
* The index page of the resource.
|
||||
*
|
||||
@@ -48,12 +33,7 @@ class ImageArtistRelationManager extends BaseRelationManager
|
||||
{
|
||||
return parent::table(
|
||||
$table
|
||||
->heading(ImageResource::getPluralLabel())
|
||||
->modelLabel(ImageResource::getLabel())
|
||||
->recordTitleAttribute(Image::ATTRIBUTE_PATH)
|
||||
->inverseRelationship(Image::RELATION_ARTISTS)
|
||||
->columns(ImageResource::table($table)->getColumns())
|
||||
->defaultSort(Image::TABLE . '.' . Image::ATTRIBUTE_ID, 'desc')
|
||||
);
|
||||
}
|
||||
|
||||
@@ -67,8 +47,8 @@ class ImageArtistRelationManager extends BaseRelationManager
|
||||
public static function getFilters(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getFilters(),
|
||||
[],
|
||||
parent::getFilters(),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -89,7 +69,7 @@ class ImageArtistRelationManager extends BaseRelationManager
|
||||
|
||||
/**
|
||||
* Get the bulk actions available for the relation.
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
|
||||
+5
-23
@@ -4,16 +4,14 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Filament\Resources\Wiki\Artist\RelationManagers;
|
||||
|
||||
use App\Filament\Resources\BaseRelationManager;
|
||||
use App\Filament\Resources\Wiki\Artist as ArtistResource;
|
||||
use App\Filament\RelationManagers\Wiki\ArtistRelationManager;
|
||||
use App\Models\Wiki\Artist;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Tables\Table;
|
||||
|
||||
/**
|
||||
* Class MemberArtistRelationManager.
|
||||
*/
|
||||
class MemberArtistRelationManager extends BaseRelationManager
|
||||
class MemberArtistRelationManager extends ArtistRelationManager
|
||||
{
|
||||
/**
|
||||
* The relationship the relation manager corresponds to.
|
||||
@@ -22,19 +20,6 @@ class MemberArtistRelationManager extends BaseRelationManager
|
||||
*/
|
||||
protected static string $relationship = Artist::RELATION_MEMBERS;
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
@@ -47,13 +32,10 @@ class MemberArtistRelationManager extends BaseRelationManager
|
||||
{
|
||||
return parent::table(
|
||||
$table
|
||||
->heading(__('filament.resources.label.members'))
|
||||
->modelLabel(__('filament.resources.singularLabel.member'))
|
||||
->recordTitleAttribute(Artist::ATTRIBUTE_NAME)
|
||||
->inverseRelationship(Artist::RELATION_GROUPS)
|
||||
->columns(ArtistResource::table($table)->getColumns())
|
||||
->defaultSort(Artist::TABLE . '.' . Artist::ATTRIBUTE_ID, 'desc')
|
||||
);
|
||||
)
|
||||
->heading(__('filament.resources.label.members'))
|
||||
->modelLabel(__('filament.resources.singularLabel.member'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+4
-24
@@ -4,17 +4,15 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Filament\Resources\Wiki\Artist\RelationManagers;
|
||||
|
||||
use App\Filament\Resources\BaseRelationManager;
|
||||
use App\Filament\Resources\Wiki\ExternalResource as ExternalResourceResource;
|
||||
use App\Filament\RelationManagers\Wiki\ResourceRelationManager;
|
||||
use App\Models\Wiki\Artist;
|
||||
use App\Models\Wiki\ExternalResource;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Tables\Table;
|
||||
|
||||
/**
|
||||
* Class ResourceArtistRelationManager.
|
||||
*/
|
||||
class ResourceArtistRelationManager extends BaseRelationManager
|
||||
class ResourceArtistRelationManager extends ResourceRelationManager
|
||||
{
|
||||
/**
|
||||
* The relationship the relation manager corresponds to.
|
||||
@@ -23,19 +21,6 @@ class ResourceArtistRelationManager extends BaseRelationManager
|
||||
*/
|
||||
protected static string $relationship = Artist::RELATION_RESOURCES;
|
||||
|
||||
/**
|
||||
* The form to the actions.
|
||||
*
|
||||
* @param Form $form
|
||||
* @return Form
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public function form(Form $form): Form
|
||||
{
|
||||
return ExternalResourceResource::form($form);
|
||||
}
|
||||
|
||||
/**
|
||||
* The index page of the resource.
|
||||
*
|
||||
@@ -48,12 +33,7 @@ class ResourceArtistRelationManager extends BaseRelationManager
|
||||
{
|
||||
return parent::table(
|
||||
$table
|
||||
->heading(ExternalResourceResource::getPluralLabel())
|
||||
->modelLabel(ExternalResourceResource::getLabel())
|
||||
->recordTitleAttribute(ExternalResource::ATTRIBUTE_LINK)
|
||||
->inverseRelationship(ExternalResource::RELATION_ARTISTS)
|
||||
->columns(ExternalResourceResource::table($table)->getColumns())
|
||||
->defaultSort(ExternalResource::TABLE . '.' . ExternalResource::ATTRIBUTE_ID, 'desc')
|
||||
);
|
||||
}
|
||||
|
||||
@@ -67,8 +47,8 @@ class ResourceArtistRelationManager extends BaseRelationManager
|
||||
public static function getFilters(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getFilters(),
|
||||
[],
|
||||
parent::getFilters(),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -89,7 +69,7 @@ class ResourceArtistRelationManager extends BaseRelationManager
|
||||
|
||||
/**
|
||||
* Get the bulk actions available for the relation.
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
|
||||
@@ -4,17 +4,15 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Filament\Resources\Wiki\Artist\RelationManagers;
|
||||
|
||||
use App\Filament\Resources\BaseRelationManager;
|
||||
use App\Filament\Resources\Wiki\Song as SongResource;
|
||||
use App\Filament\RelationManagers\Wiki\SongRelationManager;
|
||||
use App\Models\Wiki\Artist;
|
||||
use App\Models\Wiki\Song;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Tables\Table;
|
||||
|
||||
/**
|
||||
* Class SongArtistRelationManager.
|
||||
*/
|
||||
class SongArtistRelationManager extends BaseRelationManager
|
||||
class SongArtistRelationManager extends SongRelationManager
|
||||
{
|
||||
/**
|
||||
* The relationship the relation manager corresponds to.
|
||||
@@ -23,19 +21,6 @@ class SongArtistRelationManager extends BaseRelationManager
|
||||
*/
|
||||
protected static string $relationship = Artist::RELATION_SONGS;
|
||||
|
||||
/**
|
||||
* The form to the actions.
|
||||
*
|
||||
* @param Form $form
|
||||
* @return Form
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public function form(Form $form): Form
|
||||
{
|
||||
return SongResource::form($form);
|
||||
}
|
||||
|
||||
/**
|
||||
* The index page of the resource.
|
||||
*
|
||||
@@ -48,12 +33,7 @@ class SongArtistRelationManager extends BaseRelationManager
|
||||
{
|
||||
return parent::table(
|
||||
$table
|
||||
->heading(SongResource::getPluralLabel())
|
||||
->modelLabel(SongResource::getLabel())
|
||||
->recordTitleAttribute(Song::ATTRIBUTE_TITLE)
|
||||
->inverseRelationship(Song::RELATION_ARTISTS)
|
||||
->columns(SongResource::table($table)->getColumns())
|
||||
->defaultSort(Song::TABLE . '.' . Song::ATTRIBUTE_ID, 'desc')
|
||||
);
|
||||
}
|
||||
|
||||
@@ -67,8 +47,8 @@ class SongArtistRelationManager extends BaseRelationManager
|
||||
public static function getFilters(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getFilters(),
|
||||
[],
|
||||
parent::getFilters(),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -89,7 +69,7 @@ class SongArtistRelationManager extends BaseRelationManager
|
||||
|
||||
/**
|
||||
* Get the bulk actions available for the relation.
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
|
||||
@@ -9,7 +9,6 @@ use App\Filament\Actions\Storage\Wiki\Audio\DeleteAudioAction;
|
||||
use App\Filament\Actions\Storage\Wiki\Audio\MoveAudioAction;
|
||||
use App\Filament\Components\Columns\TextColumn;
|
||||
use App\Filament\Components\Filters\NumberFilter;
|
||||
use App\Filament\Components\Filters\TextFilter;
|
||||
use App\Filament\Components\Infolist\TextEntry;
|
||||
use App\Filament\Resources\BaseResource;
|
||||
use App\Filament\Resources\Wiki\Audio\Pages\CreateAudio;
|
||||
@@ -238,8 +237,7 @@ class Audio extends BaseResource
|
||||
return array_merge(
|
||||
[
|
||||
NumberFilter::make(AudioModel::ATTRIBUTE_SIZE)
|
||||
->labels(__('filament.filters.audio.size_from'), __('filament.filters.audio.size_to'))
|
||||
->attribute(AudioModel::ATTRIBUTE_SIZE),
|
||||
->labels(__('filament.filters.audio.size_from'), __('filament.filters.audio.size_to')),
|
||||
],
|
||||
parent::getFilters(),
|
||||
);
|
||||
|
||||
@@ -4,18 +4,15 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Filament\Resources\Wiki\Audio\RelationManagers;
|
||||
|
||||
use App\Filament\Resources\BaseRelationManager;
|
||||
use App\Filament\Resources\Wiki\Audio as AudioResource;
|
||||
use App\Filament\Resources\Wiki\Video as VideoResource;
|
||||
use App\Filament\RelationManagers\Wiki\VideoRelationManager;
|
||||
use App\Models\Wiki\Audio;
|
||||
use App\Models\Wiki\Video;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Tables\Table;
|
||||
|
||||
/**
|
||||
* Class VideoAudioRelationManager.
|
||||
*/
|
||||
class VideoAudioRelationManager extends BaseRelationManager
|
||||
class VideoAudioRelationManager extends VideoRelationManager
|
||||
{
|
||||
/**
|
||||
* The relationship the relation manager corresponds to.
|
||||
@@ -24,19 +21,6 @@ class VideoAudioRelationManager extends BaseRelationManager
|
||||
*/
|
||||
protected static string $relationship = Audio::RELATION_VIDEOS;
|
||||
|
||||
/**
|
||||
* The form to the actions.
|
||||
*
|
||||
* @param Form $form
|
||||
* @return Form
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public function form(Form $form): Form
|
||||
{
|
||||
return VideoResource::form($form);
|
||||
}
|
||||
|
||||
/**
|
||||
* The index page of the resource.
|
||||
*
|
||||
@@ -49,12 +33,7 @@ class VideoAudioRelationManager extends BaseRelationManager
|
||||
{
|
||||
return parent::table(
|
||||
$table
|
||||
->heading(VideoResource::getPluralLabel())
|
||||
->modelLabel(VideoResource::getLabel())
|
||||
->recordTitleAttribute(Video::ATTRIBUTE_FILENAME)
|
||||
->inverseRelationship(Video::RELATION_AUDIO)
|
||||
->columns(VideoResource::table($table)->getColumns())
|
||||
->defaultSort(Video::TABLE . '.' . Video::ATTRIBUTE_ID, 'desc')
|
||||
);
|
||||
}
|
||||
|
||||
@@ -68,8 +47,8 @@ class VideoAudioRelationManager extends BaseRelationManager
|
||||
public static function getFilters(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getFilters(),
|
||||
[],
|
||||
parent::getFilters(),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -90,7 +69,7 @@ class VideoAudioRelationManager extends BaseRelationManager
|
||||
|
||||
/**
|
||||
* Get the bulk actions available for the relation.
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
|
||||
@@ -9,7 +9,7 @@ use App\Filament\Components\Columns\TextColumn;
|
||||
use App\Filament\Components\Fields\Select;
|
||||
use App\Filament\Components\Filters\NumberFilter;
|
||||
use App\Filament\Components\Infolist\TextEntry;
|
||||
use App\Filament\Resources\BaseRelationManager;
|
||||
use App\Filament\RelationManagers\Wiki\ResourceRelationManager;
|
||||
use App\Filament\Resources\BaseResource;
|
||||
use App\Filament\Resources\Wiki\ExternalResource\Pages\CreateExternalResource;
|
||||
use App\Filament\Resources\Wiki\ExternalResource\Pages\EditExternalResource;
|
||||
@@ -155,7 +155,7 @@ class ExternalResource extends BaseResource
|
||||
TextInput::make(AnimeResource::ATTRIBUTE_AS)
|
||||
->label(__('filament.fields.anime.resources.as.name'))
|
||||
->helperText(__('filament.fields.anime.resources.as.help'))
|
||||
->visibleOn(BaseRelationManager::class),
|
||||
->visibleOn(ResourceRelationManager::class),
|
||||
])
|
||||
->columns(1);
|
||||
}
|
||||
@@ -197,7 +197,7 @@ class ExternalResource extends BaseResource
|
||||
|
||||
TextColumn::make(AnimeResource::ATTRIBUTE_AS)
|
||||
->label(__('filament.fields.anime.resources.as.name'))
|
||||
->visibleOn(BaseRelationManager::class)
|
||||
->visibleOn(ResourceRelationManager::class)
|
||||
->placeholder('-'),
|
||||
]);
|
||||
}
|
||||
@@ -271,8 +271,7 @@ class ExternalResource extends BaseResource
|
||||
->options(ResourceSite::asSelectArray()),
|
||||
|
||||
NumberFilter::make(ExternalResourceModel::ATTRIBUTE_EXTERNAL_ID)
|
||||
->labels(__('filament.filters.external_resource.external_id_from'), __('filament.filters.external_resource.external_id_to'))
|
||||
->attribute(ExternalResourceModel::ATTRIBUTE_EXTERNAL_ID),
|
||||
->labels(__('filament.filters.external_resource.external_id_from'), __('filament.filters.external_resource.external_id_to')),
|
||||
],
|
||||
parent::getFilters(),
|
||||
);
|
||||
|
||||
+4
-24
@@ -4,17 +4,15 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Filament\Resources\Wiki\ExternalResource\RelationManagers;
|
||||
|
||||
use App\Filament\Resources\BaseRelationManager;
|
||||
use App\Filament\Resources\Wiki\Anime as AnimeResource;
|
||||
use App\Filament\RelationManagers\Wiki\AnimeRelationManager;
|
||||
use App\Models\Wiki\Anime;
|
||||
use App\Models\Wiki\ExternalResource;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Tables\Table;
|
||||
|
||||
/**
|
||||
* Class AnimeResourceRelationManager.
|
||||
*/
|
||||
class AnimeResourceRelationManager extends BaseRelationManager
|
||||
class AnimeResourceRelationManager extends AnimeRelationManager
|
||||
{
|
||||
/**
|
||||
* The relationship the relation manager corresponds to.
|
||||
@@ -23,19 +21,6 @@ class AnimeResourceRelationManager extends BaseRelationManager
|
||||
*/
|
||||
protected static string $relationship = ExternalResource::RELATION_ANIME;
|
||||
|
||||
/**
|
||||
* The form to the actions.
|
||||
*
|
||||
* @param Form $form
|
||||
* @return Form
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public function form(Form $form): Form
|
||||
{
|
||||
return AnimeResource::form($form);
|
||||
}
|
||||
|
||||
/**
|
||||
* The index page of the resource.
|
||||
*
|
||||
@@ -48,12 +33,7 @@ class AnimeResourceRelationManager extends BaseRelationManager
|
||||
{
|
||||
return parent::table(
|
||||
$table
|
||||
->heading(AnimeResource::getPluralLabel())
|
||||
->modelLabel(AnimeResource::getLabel())
|
||||
->recordTitleAttribute(Anime::ATTRIBUTE_NAME)
|
||||
->inverseRelationship(Anime::RELATION_RESOURCES)
|
||||
->columns(AnimeResource::table($table)->getColumns())
|
||||
->defaultSort(Anime::TABLE . '.' . Anime::ATTRIBUTE_ID, 'desc')
|
||||
);
|
||||
}
|
||||
|
||||
@@ -67,8 +47,8 @@ class AnimeResourceRelationManager extends BaseRelationManager
|
||||
public static function getFilters(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getFilters(),
|
||||
[],
|
||||
parent::getFilters(),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -89,7 +69,7 @@ class AnimeResourceRelationManager extends BaseRelationManager
|
||||
|
||||
/**
|
||||
* Get the bulk actions available for the relation.
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
|
||||
+4
-24
@@ -4,17 +4,15 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Filament\Resources\Wiki\ExternalResource\RelationManagers;
|
||||
|
||||
use App\Filament\Resources\BaseRelationManager;
|
||||
use App\Filament\Resources\Wiki\Artist as ArtistResource;
|
||||
use App\Filament\RelationManagers\Wiki\ArtistRelationManager;
|
||||
use App\Models\Wiki\Artist;
|
||||
use App\Models\Wiki\ExternalResource;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Tables\Table;
|
||||
|
||||
/**
|
||||
* Class ArtistResourceRelationManager.
|
||||
*/
|
||||
class ArtistResourceRelationManager extends BaseRelationManager
|
||||
class ArtistResourceRelationManager extends ArtistRelationManager
|
||||
{
|
||||
/**
|
||||
* The relationship the relation manager corresponds to.
|
||||
@@ -23,19 +21,6 @@ class ArtistResourceRelationManager extends BaseRelationManager
|
||||
*/
|
||||
protected static string $relationship = ExternalResource::RELATION_ARTISTS;
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
@@ -48,12 +33,7 @@ class ArtistResourceRelationManager extends BaseRelationManager
|
||||
{
|
||||
return parent::table(
|
||||
$table
|
||||
->heading(ArtistResource::getPluralLabel())
|
||||
->modelLabel(ArtistResource::getLabel())
|
||||
->recordTitleAttribute(Artist::ATTRIBUTE_NAME)
|
||||
->inverseRelationship(Artist::RELATION_RESOURCES)
|
||||
->columns(ArtistResource::table($table)->getColumns())
|
||||
->defaultSort(Artist::TABLE . '.' . Artist::ATTRIBUTE_ID, 'desc')
|
||||
);
|
||||
}
|
||||
|
||||
@@ -67,8 +47,8 @@ class ArtistResourceRelationManager extends BaseRelationManager
|
||||
public static function getFilters(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getFilters(),
|
||||
[],
|
||||
parent::getFilters(),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -89,7 +69,7 @@ class ArtistResourceRelationManager extends BaseRelationManager
|
||||
|
||||
/**
|
||||
* Get the bulk actions available for the relation.
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
|
||||
+4
-24
@@ -4,17 +4,15 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Filament\Resources\Wiki\ExternalResource\RelationManagers;
|
||||
|
||||
use App\Filament\Resources\BaseRelationManager;
|
||||
use App\Filament\Resources\Wiki\Song as SongResource;
|
||||
use App\Filament\RelationManagers\Wiki\SongRelationManager;
|
||||
use App\Models\Wiki\Song;
|
||||
use App\Models\Wiki\ExternalResource;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Tables\Table;
|
||||
|
||||
/**
|
||||
* Class SongResourceRelationManager.
|
||||
*/
|
||||
class SongResourceRelationManager extends BaseRelationManager
|
||||
class SongResourceRelationManager extends SongRelationManager
|
||||
{
|
||||
/**
|
||||
* The relationship the relation manager corresponds to.
|
||||
@@ -23,19 +21,6 @@ class SongResourceRelationManager extends BaseRelationManager
|
||||
*/
|
||||
protected static string $relationship = ExternalResource::RELATION_SONGS;
|
||||
|
||||
/**
|
||||
* The form to the actions.
|
||||
*
|
||||
* @param Form $form
|
||||
* @return Form
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public function form(Form $form): Form
|
||||
{
|
||||
return SongResource::form($form);
|
||||
}
|
||||
|
||||
/**
|
||||
* The index page of the resource.
|
||||
*
|
||||
@@ -48,12 +33,7 @@ class SongResourceRelationManager extends BaseRelationManager
|
||||
{
|
||||
return parent::table(
|
||||
$table
|
||||
->heading(SongResource::getPluralLabel())
|
||||
->modelLabel(SongResource::getLabel())
|
||||
->recordTitleAttribute(Song::ATTRIBUTE_TITLE)
|
||||
->inverseRelationship(Song::RELATION_RESOURCES)
|
||||
->columns(SongResource::table($table)->getColumns())
|
||||
->defaultSort(Song::TABLE . '.' . Song::ATTRIBUTE_ID, 'desc')
|
||||
);
|
||||
}
|
||||
|
||||
@@ -67,8 +47,8 @@ class SongResourceRelationManager extends BaseRelationManager
|
||||
public static function getFilters(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getFilters(),
|
||||
[],
|
||||
parent::getFilters(),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -89,7 +69,7 @@ class SongResourceRelationManager extends BaseRelationManager
|
||||
|
||||
/**
|
||||
* Get the bulk actions available for the relation.
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
|
||||
+4
-24
@@ -4,17 +4,15 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Filament\Resources\Wiki\ExternalResource\RelationManagers;
|
||||
|
||||
use App\Filament\Resources\BaseRelationManager;
|
||||
use App\Filament\Resources\Wiki\Studio as StudioResource;
|
||||
use App\Filament\RelationManagers\Wiki\StudioRelationManager;
|
||||
use App\Models\Wiki\Studio;
|
||||
use App\Models\Wiki\ExternalResource;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Tables\Table;
|
||||
|
||||
/**
|
||||
* Class StudioResourceRelationManager.
|
||||
*/
|
||||
class StudioResourceRelationManager extends BaseRelationManager
|
||||
class StudioResourceRelationManager extends StudioRelationManager
|
||||
{
|
||||
/**
|
||||
* The relationship the relation manager corresponds to.
|
||||
@@ -23,19 +21,6 @@ class StudioResourceRelationManager extends BaseRelationManager
|
||||
*/
|
||||
protected static string $relationship = ExternalResource::RELATION_STUDIOS;
|
||||
|
||||
/**
|
||||
* The form to the actions.
|
||||
*
|
||||
* @param Form $form
|
||||
* @return Form
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public function form(Form $form): Form
|
||||
{
|
||||
return StudioResource::form($form);
|
||||
}
|
||||
|
||||
/**
|
||||
* The index page of the resource.
|
||||
*
|
||||
@@ -48,12 +33,7 @@ class StudioResourceRelationManager extends BaseRelationManager
|
||||
{
|
||||
return parent::table(
|
||||
$table
|
||||
->heading(StudioResource::getPluralLabel())
|
||||
->modelLabel(StudioResource::getLabel())
|
||||
->recordTitleAttribute(Studio::ATTRIBUTE_NAME)
|
||||
->inverseRelationship(Studio::RELATION_RESOURCES)
|
||||
->columns(StudioResource::table($table)->getColumns())
|
||||
->defaultSort(Studio::TABLE . '.' . Studio::ATTRIBUTE_ID, 'desc')
|
||||
);
|
||||
}
|
||||
|
||||
@@ -67,8 +47,8 @@ class StudioResourceRelationManager extends BaseRelationManager
|
||||
public static function getFilters(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getFilters(),
|
||||
[],
|
||||
parent::getFilters(),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -89,7 +69,7 @@ class StudioResourceRelationManager extends BaseRelationManager
|
||||
|
||||
/**
|
||||
* Get the bulk actions available for the relation.
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
|
||||
@@ -4,17 +4,15 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Filament\Resources\Wiki\Group\RelationManagers;
|
||||
|
||||
use App\Filament\Resources\BaseRelationManager;
|
||||
use App\Filament\Resources\Wiki\Anime\Theme as ThemeResource;
|
||||
use App\Filament\RelationManagers\Wiki\Anime\ThemeRelationManager;
|
||||
use App\Models\Wiki\Group;
|
||||
use App\Models\Wiki\Anime\AnimeTheme as ThemeModel;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Tables\Table;
|
||||
|
||||
/**
|
||||
* Class ThemeGroupRelationManager.
|
||||
*/
|
||||
class ThemeGroupRelationManager extends BaseRelationManager
|
||||
class ThemeGroupRelationManager extends ThemeRelationManager
|
||||
{
|
||||
/**
|
||||
* The relationship the relation manager corresponds to.
|
||||
@@ -23,19 +21,6 @@ class ThemeGroupRelationManager extends BaseRelationManager
|
||||
*/
|
||||
protected static string $relationship = Group::RELATION_THEMES;
|
||||
|
||||
/**
|
||||
* The form to the actions.
|
||||
*
|
||||
* @param Form $form
|
||||
* @return Form
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public function form(Form $form): Form
|
||||
{
|
||||
return ThemeResource::form($form);
|
||||
}
|
||||
|
||||
/**
|
||||
* The index page of the Theme.
|
||||
*
|
||||
@@ -48,12 +33,7 @@ class ThemeGroupRelationManager extends BaseRelationManager
|
||||
{
|
||||
return parent::table(
|
||||
$table
|
||||
->heading(ThemeResource::getPluralLabel())
|
||||
->modelLabel(ThemeResource::getLabel())
|
||||
->recordTitleAttribute(ThemeModel::ATTRIBUTE_SLUG)
|
||||
->inverseRelationship(ThemeModel::RELATION_GROUP)
|
||||
->columns(ThemeResource::table($table)->getColumns())
|
||||
->defaultSort(ThemeModel::TABLE . '.' . ThemeModel::ATTRIBUTE_ID, 'desc')
|
||||
);
|
||||
}
|
||||
|
||||
@@ -67,8 +47,8 @@ class ThemeGroupRelationManager extends BaseRelationManager
|
||||
public static function getFilters(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getFilters(),
|
||||
[],
|
||||
parent::getFilters(),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -89,7 +69,7 @@ class ThemeGroupRelationManager extends BaseRelationManager
|
||||
|
||||
/**
|
||||
* Get the bulk actions available for the relation.
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
|
||||
@@ -4,17 +4,15 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Filament\Resources\Wiki\Image\RelationManagers;
|
||||
|
||||
use App\Filament\Resources\BaseRelationManager;
|
||||
use App\Filament\Resources\Wiki\Anime as AnimeResource;
|
||||
use App\Filament\RelationManagers\Wiki\AnimeRelationManager;
|
||||
use App\Models\Wiki\Image;
|
||||
use App\Models\Wiki\Anime;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Tables\Table;
|
||||
|
||||
/**
|
||||
* Class AnimeImageRelationManager.
|
||||
*/
|
||||
class AnimeImageRelationManager extends BaseRelationManager
|
||||
class AnimeImageRelationManager extends AnimeRelationManager
|
||||
{
|
||||
/**
|
||||
* The relationship the relation manager corresponds to.
|
||||
@@ -23,19 +21,6 @@ class AnimeImageRelationManager extends BaseRelationManager
|
||||
*/
|
||||
protected static string $relationship = Image::RELATION_ANIME;
|
||||
|
||||
/**
|
||||
* The form to the actions.
|
||||
*
|
||||
* @param Form $form
|
||||
* @return Form
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public function form(Form $form): Form
|
||||
{
|
||||
return AnimeResource::form($form);
|
||||
}
|
||||
|
||||
/**
|
||||
* The index page of the resource.
|
||||
*
|
||||
@@ -48,12 +33,7 @@ class AnimeImageRelationManager extends BaseRelationManager
|
||||
{
|
||||
return parent::table(
|
||||
$table
|
||||
->heading(AnimeResource::getPluralLabel())
|
||||
->modelLabel(AnimeResource::getLabel())
|
||||
->recordTitleAttribute(Anime::ATTRIBUTE_NAME)
|
||||
->inverseRelationship(Anime::RELATION_IMAGES)
|
||||
->columns(AnimeResource::table($table)->getColumns())
|
||||
->defaultSort(Anime::TABLE . '.' . Anime::ATTRIBUTE_ID, 'desc')
|
||||
);
|
||||
}
|
||||
|
||||
@@ -67,8 +47,8 @@ class AnimeImageRelationManager extends BaseRelationManager
|
||||
public static function getFilters(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getFilters(),
|
||||
[],
|
||||
parent::getFilters(),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -89,7 +69,7 @@ class AnimeImageRelationManager extends BaseRelationManager
|
||||
|
||||
/**
|
||||
* Get the bulk actions available for the relation.
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
|
||||
@@ -4,17 +4,15 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Filament\Resources\Wiki\Image\RelationManagers;
|
||||
|
||||
use App\Filament\Resources\BaseRelationManager;
|
||||
use App\Filament\Resources\Wiki\Artist as ArtistResource;
|
||||
use App\Filament\RelationManagers\Wiki\ArtistRelationManager;
|
||||
use App\Models\Wiki\Image;
|
||||
use App\Models\Wiki\Artist;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Tables\Table;
|
||||
|
||||
/**
|
||||
* Class ArtistImageRelationManager.
|
||||
*/
|
||||
class ArtistImageRelationManager extends BaseRelationManager
|
||||
class ArtistImageRelationManager extends ArtistRelationManager
|
||||
{
|
||||
/**
|
||||
* The relationship the relation manager corresponds to.
|
||||
@@ -23,19 +21,6 @@ class ArtistImageRelationManager extends BaseRelationManager
|
||||
*/
|
||||
protected static string $relationship = Image::RELATION_ARTISTS;
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
@@ -48,12 +33,7 @@ class ArtistImageRelationManager extends BaseRelationManager
|
||||
{
|
||||
return parent::table(
|
||||
$table
|
||||
->heading(ArtistResource::getPluralLabel())
|
||||
->modelLabel(ArtistResource::getLabel())
|
||||
->recordTitleAttribute(Artist::ATTRIBUTE_NAME)
|
||||
->inverseRelationship(Artist::RELATION_IMAGES)
|
||||
->columns(ArtistResource::table($table)->getColumns())
|
||||
->defaultSort(Artist::TABLE . '.' . Artist::ATTRIBUTE_ID, 'desc')
|
||||
);
|
||||
}
|
||||
|
||||
@@ -67,8 +47,8 @@ class ArtistImageRelationManager extends BaseRelationManager
|
||||
public static function getFilters(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getFilters(),
|
||||
[],
|
||||
parent::getFilters(),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -89,7 +69,7 @@ class ArtistImageRelationManager extends BaseRelationManager
|
||||
|
||||
/**
|
||||
* Get the bulk actions available for the relation.
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
|
||||
+4
-24
@@ -4,17 +4,15 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Filament\Resources\Wiki\Image\RelationManagers;
|
||||
|
||||
use App\Filament\Resources\BaseRelationManager;
|
||||
use App\Filament\Resources\List\Playlist as PlaylistResource;
|
||||
use App\Filament\RelationManagers\List\PlaylistRelationManager;
|
||||
use App\Models\Wiki\Image;
|
||||
use App\Models\List\Playlist;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Tables\Table;
|
||||
|
||||
/**
|
||||
* Class PlaylistImageRelationManager.
|
||||
*/
|
||||
class PlaylistImageRelationManager extends BaseRelationManager
|
||||
class PlaylistImageRelationManager extends PlaylistRelationManager
|
||||
{
|
||||
/**
|
||||
* The relationship the relation manager corresponds to.
|
||||
@@ -23,19 +21,6 @@ class PlaylistImageRelationManager extends BaseRelationManager
|
||||
*/
|
||||
protected static string $relationship = Image::RELATION_PLAYLISTS;
|
||||
|
||||
/**
|
||||
* The form to the actions.
|
||||
*
|
||||
* @param Form $form
|
||||
* @return Form
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public function form(Form $form): Form
|
||||
{
|
||||
return PlaylistResource::form($form);
|
||||
}
|
||||
|
||||
/**
|
||||
* The index page of the resource.
|
||||
*
|
||||
@@ -48,12 +33,7 @@ class PlaylistImageRelationManager extends BaseRelationManager
|
||||
{
|
||||
return parent::table(
|
||||
$table
|
||||
->heading(PlaylistResource::getPluralLabel())
|
||||
->modelLabel(PlaylistResource::getLabel())
|
||||
->recordTitleAttribute(Playlist::ATTRIBUTE_NAME)
|
||||
->inverseRelationship(Playlist::RELATION_IMAGES)
|
||||
->columns(PlaylistResource::table($table)->getColumns())
|
||||
->defaultSort(Playlist::TABLE . '.' . Playlist::ATTRIBUTE_ID, 'desc')
|
||||
);
|
||||
}
|
||||
|
||||
@@ -67,8 +47,8 @@ class PlaylistImageRelationManager extends BaseRelationManager
|
||||
public static function getFilters(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getFilters(),
|
||||
[],
|
||||
parent::getFilters(),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -89,7 +69,7 @@ class PlaylistImageRelationManager extends BaseRelationManager
|
||||
|
||||
/**
|
||||
* Get the bulk actions available for the relation.
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
|
||||
@@ -4,17 +4,15 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Filament\Resources\Wiki\Image\RelationManagers;
|
||||
|
||||
use App\Filament\Resources\BaseRelationManager;
|
||||
use App\Filament\Resources\Wiki\Studio as StudioResource;
|
||||
use App\Filament\RelationManagers\Wiki\StudioRelationManager;
|
||||
use App\Models\Wiki\Image;
|
||||
use App\Models\Wiki\Studio;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Tables\Table;
|
||||
|
||||
/**
|
||||
* Class StudioImageRelationManager.
|
||||
*/
|
||||
class StudioImageRelationManager extends BaseRelationManager
|
||||
class StudioImageRelationManager extends StudioRelationManager
|
||||
{
|
||||
/**
|
||||
* The relationship the relation manager corresponds to.
|
||||
@@ -23,19 +21,6 @@ class StudioImageRelationManager extends BaseRelationManager
|
||||
*/
|
||||
protected static string $relationship = Image::RELATION_STUDIOS;
|
||||
|
||||
/**
|
||||
* The form to the actions.
|
||||
*
|
||||
* @param Form $form
|
||||
* @return Form
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public function form(Form $form): Form
|
||||
{
|
||||
return StudioResource::form($form);
|
||||
}
|
||||
|
||||
/**
|
||||
* The index page of the resource.
|
||||
*
|
||||
@@ -48,12 +33,7 @@ class StudioImageRelationManager extends BaseRelationManager
|
||||
{
|
||||
return parent::table(
|
||||
$table
|
||||
->heading(StudioResource::getPluralLabel())
|
||||
->modelLabel(StudioResource::getLabel())
|
||||
->recordTitleAttribute(Studio::ATTRIBUTE_NAME)
|
||||
->inverseRelationship(Studio::RELATION_IMAGES)
|
||||
->columns(StudioResource::table($table)->getColumns())
|
||||
->defaultSort(Studio::TABLE . '.' . Studio::ATTRIBUTE_ID, 'desc')
|
||||
);
|
||||
}
|
||||
|
||||
@@ -67,8 +47,8 @@ class StudioImageRelationManager extends BaseRelationManager
|
||||
public static function getFilters(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getFilters(),
|
||||
[],
|
||||
parent::getFilters(),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -89,7 +69,7 @@ class StudioImageRelationManager extends BaseRelationManager
|
||||
|
||||
/**
|
||||
* Get the bulk actions available for the relation.
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
|
||||
@@ -4,17 +4,15 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Filament\Resources\Wiki\Series\RelationManagers;
|
||||
|
||||
use App\Filament\Resources\BaseRelationManager;
|
||||
use App\Filament\Resources\Wiki\Anime as AnimeResource;
|
||||
use App\Filament\RelationManagers\Wiki\AnimeRelationManager;
|
||||
use App\Models\Wiki\Series;
|
||||
use App\Models\Wiki\Anime;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Tables\Table;
|
||||
|
||||
/**
|
||||
* Class AnimeSeriesRelationManager.
|
||||
*/
|
||||
class AnimeSeriesRelationManager extends BaseRelationManager
|
||||
class AnimeSeriesRelationManager extends AnimeRelationManager
|
||||
{
|
||||
/**
|
||||
* The relationship the relation manager corresponds to.
|
||||
@@ -23,19 +21,6 @@ class AnimeSeriesRelationManager extends BaseRelationManager
|
||||
*/
|
||||
protected static string $relationship = Series::RELATION_ANIME;
|
||||
|
||||
/**
|
||||
* The form to the actions.
|
||||
*
|
||||
* @param Form $form
|
||||
* @return Form
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public function form(Form $form): Form
|
||||
{
|
||||
return AnimeResource::form($form);
|
||||
}
|
||||
|
||||
/**
|
||||
* The index page of the resource.
|
||||
*
|
||||
@@ -48,12 +33,7 @@ class AnimeSeriesRelationManager extends BaseRelationManager
|
||||
{
|
||||
return parent::table(
|
||||
$table
|
||||
->heading(AnimeResource::getPluralLabel())
|
||||
->modelLabel(AnimeResource::getLabel())
|
||||
->recordTitleAttribute(Anime::ATTRIBUTE_NAME)
|
||||
->inverseRelationship(Anime::RELATION_SERIES)
|
||||
->columns(AnimeResource::table($table)->getColumns())
|
||||
->defaultSort(Anime::TABLE . '.' . Anime::ATTRIBUTE_ID, 'desc')
|
||||
);
|
||||
}
|
||||
|
||||
@@ -67,8 +47,8 @@ class AnimeSeriesRelationManager extends BaseRelationManager
|
||||
public static function getFilters(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getFilters(),
|
||||
[],
|
||||
parent::getFilters(),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -89,7 +69,7 @@ class AnimeSeriesRelationManager extends BaseRelationManager
|
||||
|
||||
/**
|
||||
* Get the bulk actions available for the relation.
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
|
||||
@@ -4,17 +4,15 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Filament\Resources\Wiki\Song\RelationManagers;
|
||||
|
||||
use App\Filament\Resources\BaseRelationManager;
|
||||
use App\Filament\Resources\Wiki\Artist as ArtistResource;
|
||||
use App\Filament\RelationManagers\Wiki\ArtistRelationManager;
|
||||
use App\Models\Wiki\Song;
|
||||
use App\Models\Wiki\Artist;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Tables\Table;
|
||||
|
||||
/**
|
||||
* Class ArtistSongRelationManager.
|
||||
*/
|
||||
class ArtistSongRelationManager extends BaseRelationManager
|
||||
class ArtistSongRelationManager extends ArtistRelationManager
|
||||
{
|
||||
/**
|
||||
* The relationship the relation manager corresponds to.
|
||||
@@ -23,19 +21,6 @@ class ArtistSongRelationManager extends BaseRelationManager
|
||||
*/
|
||||
protected static string $relationship = Song::RELATION_ARTISTS;
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
@@ -48,12 +33,7 @@ class ArtistSongRelationManager extends BaseRelationManager
|
||||
{
|
||||
return parent::table(
|
||||
$table
|
||||
->heading(ArtistResource::getPluralLabel())
|
||||
->modelLabel(ArtistResource::getLabel())
|
||||
->recordTitleAttribute(Artist::ATTRIBUTE_NAME)
|
||||
->inverseRelationship(Artist::RELATION_SONGS)
|
||||
->columns(ArtistResource::table($table)->getColumns())
|
||||
->defaultSort(Artist::TABLE . '.' . Artist::ATTRIBUTE_ID, 'desc')
|
||||
);
|
||||
}
|
||||
|
||||
@@ -67,8 +47,8 @@ class ArtistSongRelationManager extends BaseRelationManager
|
||||
public static function getFilters(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getFilters(),
|
||||
[],
|
||||
parent::getFilters(),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -89,7 +69,7 @@ class ArtistSongRelationManager extends BaseRelationManager
|
||||
|
||||
/**
|
||||
* Get the bulk actions available for the relation.
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
|
||||
@@ -4,17 +4,15 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Filament\Resources\Wiki\Song\RelationManagers;
|
||||
|
||||
use App\Filament\Resources\BaseRelationManager;
|
||||
use App\Filament\Resources\Wiki\ExternalResource as ExternalResourceResource;
|
||||
use App\Filament\RelationManagers\Wiki\ResourceRelationManager;
|
||||
use App\Models\Wiki\Song;
|
||||
use App\Models\Wiki\ExternalResource;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Tables\Table;
|
||||
|
||||
/**
|
||||
* Class ResourceSongRelationManager.
|
||||
*/
|
||||
class ResourceSongRelationManager extends BaseRelationManager
|
||||
class ResourceSongRelationManager extends ResourceRelationManager
|
||||
{
|
||||
/**
|
||||
* The relationship the relation manager corresponds to.
|
||||
@@ -23,19 +21,6 @@ class ResourceSongRelationManager extends BaseRelationManager
|
||||
*/
|
||||
protected static string $relationship = Song::RELATION_RESOURCES;
|
||||
|
||||
/**
|
||||
* The form to the actions.
|
||||
*
|
||||
* @param Form $form
|
||||
* @return Form
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public function form(Form $form): Form
|
||||
{
|
||||
return ExternalResourceResource::form($form);
|
||||
}
|
||||
|
||||
/**
|
||||
* The index page of the resource.
|
||||
*
|
||||
@@ -48,12 +33,7 @@ class ResourceSongRelationManager extends BaseRelationManager
|
||||
{
|
||||
return parent::table(
|
||||
$table
|
||||
->heading(ExternalResourceResource::getPluralLabel())
|
||||
->modelLabel(ExternalResourceResource::getLabel())
|
||||
->recordTitleAttribute(ExternalResource::ATTRIBUTE_LINK)
|
||||
->inverseRelationship(ExternalResource::RELATION_SONGS)
|
||||
->columns(ExternalResourceResource::table($table)->getColumns())
|
||||
->defaultSort(ExternalResource::TABLE . '.' . ExternalResource::ATTRIBUTE_ID, 'desc')
|
||||
);
|
||||
}
|
||||
|
||||
@@ -67,8 +47,8 @@ class ResourceSongRelationManager extends BaseRelationManager
|
||||
public static function getFilters(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getFilters(),
|
||||
[],
|
||||
parent::getFilters(),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -89,7 +69,7 @@ class ResourceSongRelationManager extends BaseRelationManager
|
||||
|
||||
/**
|
||||
* Get the bulk actions available for the relation.
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
|
||||
@@ -4,17 +4,15 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Filament\Resources\Wiki\Song\RelationManagers;
|
||||
|
||||
use App\Filament\Resources\BaseRelationManager;
|
||||
use App\Filament\Resources\Wiki\Anime\Theme as ThemeResource;
|
||||
use App\Filament\RelationManagers\Wiki\Anime\ThemeRelationManager;
|
||||
use App\Models\Wiki\Anime\AnimeTheme as ThemeModel;
|
||||
use App\Models\Wiki\Song as SongModel;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Tables\Table;
|
||||
|
||||
/**
|
||||
* Class ThemeSongRelationManager.
|
||||
*/
|
||||
class ThemeSongRelationManager extends BaseRelationManager
|
||||
class ThemeSongRelationManager extends ThemeRelationManager
|
||||
{
|
||||
/**
|
||||
* The relationship the relation manager corresponds to.
|
||||
@@ -23,19 +21,6 @@ class ThemeSongRelationManager extends BaseRelationManager
|
||||
*/
|
||||
protected static string $relationship = SongModel::RELATION_ANIMETHEMES;
|
||||
|
||||
/**
|
||||
* The form to the actions.
|
||||
*
|
||||
* @param Form $form
|
||||
* @return Form
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public function form(Form $form): Form
|
||||
{
|
||||
return ThemeResource::form($form);
|
||||
}
|
||||
|
||||
/**
|
||||
* The index page of the Theme.
|
||||
*
|
||||
@@ -48,12 +33,7 @@ class ThemeSongRelationManager extends BaseRelationManager
|
||||
{
|
||||
return parent::table(
|
||||
$table
|
||||
->heading(ThemeResource::getPluralLabel())
|
||||
->modelLabel(ThemeResource::getLabel())
|
||||
->recordTitleAttribute(ThemeModel::ATTRIBUTE_SLUG)
|
||||
->inverseRelationship(ThemeModel::RELATION_SONG)
|
||||
->columns(ThemeResource::table($table)->getColumns())
|
||||
->defaultSort(ThemeModel::TABLE . '.' . ThemeModel::ATTRIBUTE_ID, 'desc')
|
||||
);
|
||||
}
|
||||
|
||||
@@ -67,8 +47,8 @@ class ThemeSongRelationManager extends BaseRelationManager
|
||||
public static function getFilters(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getFilters(),
|
||||
[],
|
||||
parent::getFilters(),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -89,7 +69,7 @@ class ThemeSongRelationManager extends BaseRelationManager
|
||||
|
||||
/**
|
||||
* Get the bulk actions available for the relation.
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
|
||||
@@ -4,17 +4,15 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Filament\Resources\Wiki\Studio\RelationManagers;
|
||||
|
||||
use App\Filament\Resources\BaseRelationManager;
|
||||
use App\Filament\Resources\Wiki\Anime as AnimeResource;
|
||||
use App\Filament\RelationManagers\Wiki\AnimeRelationManager;
|
||||
use App\Models\Wiki\Studio;
|
||||
use App\Models\Wiki\Anime;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Tables\Table;
|
||||
|
||||
/**
|
||||
* Class AnimeStudioRelationManager.
|
||||
*/
|
||||
class AnimeStudioRelationManager extends BaseRelationManager
|
||||
class AnimeStudioRelationManager extends AnimeRelationManager
|
||||
{
|
||||
/**
|
||||
* The relationship the relation manager corresponds to.
|
||||
@@ -23,19 +21,6 @@ class AnimeStudioRelationManager extends BaseRelationManager
|
||||
*/
|
||||
protected static string $relationship = Studio::RELATION_ANIME;
|
||||
|
||||
/**
|
||||
* The form to the actions.
|
||||
*
|
||||
* @param Form $form
|
||||
* @return Form
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public function form(Form $form): Form
|
||||
{
|
||||
return AnimeResource::form($form);
|
||||
}
|
||||
|
||||
/**
|
||||
* The index page of the resource.
|
||||
*
|
||||
@@ -48,12 +33,7 @@ class AnimeStudioRelationManager extends BaseRelationManager
|
||||
{
|
||||
return parent::table(
|
||||
$table
|
||||
->heading(AnimeResource::getPluralLabel())
|
||||
->modelLabel(AnimeResource::getLabel())
|
||||
->recordTitleAttribute(Anime::ATTRIBUTE_NAME)
|
||||
->inverseRelationship(Anime::RELATION_STUDIOS)
|
||||
->columns(AnimeResource::table($table)->getColumns())
|
||||
->defaultSort(Anime::TABLE . '.' . Anime::ATTRIBUTE_ID, 'desc')
|
||||
);
|
||||
}
|
||||
|
||||
@@ -67,8 +47,8 @@ class AnimeStudioRelationManager extends BaseRelationManager
|
||||
public static function getFilters(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getFilters(),
|
||||
[],
|
||||
parent::getFilters(),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -89,7 +69,7 @@ class AnimeStudioRelationManager extends BaseRelationManager
|
||||
|
||||
/**
|
||||
* Get the bulk actions available for the relation.
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
|
||||
@@ -4,17 +4,15 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Filament\Resources\Wiki\Studio\RelationManagers;
|
||||
|
||||
use App\Filament\Resources\BaseRelationManager;
|
||||
use App\Filament\Resources\Wiki\Image as ImageResource;
|
||||
use App\Filament\RelationManagers\Wiki\ImageRelationManager;
|
||||
use App\Models\Wiki\Studio;
|
||||
use App\Models\Wiki\Image;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Tables\Table;
|
||||
|
||||
/**
|
||||
* Class ImageStudioRelationManager.
|
||||
*/
|
||||
class ImageStudioRelationManager extends BaseRelationManager
|
||||
class ImageStudioRelationManager extends ImageRelationManager
|
||||
{
|
||||
/**
|
||||
* The relationship the relation manager corresponds to.
|
||||
@@ -23,19 +21,6 @@ class ImageStudioRelationManager extends BaseRelationManager
|
||||
*/
|
||||
protected static string $relationship = Studio::RELATION_IMAGES;
|
||||
|
||||
/**
|
||||
* The form to the actions.
|
||||
*
|
||||
* @param Form $form
|
||||
* @return Form
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public function form(Form $form): Form
|
||||
{
|
||||
return ImageResource::form($form);
|
||||
}
|
||||
|
||||
/**
|
||||
* The index page of the resource.
|
||||
*
|
||||
@@ -48,12 +33,7 @@ class ImageStudioRelationManager extends BaseRelationManager
|
||||
{
|
||||
return parent::table(
|
||||
$table
|
||||
->heading(ImageResource::getPluralLabel())
|
||||
->modelLabel(ImageResource::getLabel())
|
||||
->recordTitleAttribute(Image::ATTRIBUTE_PATH)
|
||||
->inverseRelationship(Image::RELATION_STUDIOS)
|
||||
->columns(ImageResource::table($table)->getColumns())
|
||||
->defaultSort(Image::TABLE . '.' . Image::ATTRIBUTE_ID, 'desc')
|
||||
);
|
||||
}
|
||||
|
||||
@@ -67,8 +47,8 @@ class ImageStudioRelationManager extends BaseRelationManager
|
||||
public static function getFilters(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getFilters(),
|
||||
[],
|
||||
parent::getFilters(),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -89,7 +69,7 @@ class ImageStudioRelationManager extends BaseRelationManager
|
||||
|
||||
/**
|
||||
* Get the bulk actions available for the relation.
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
|
||||
+4
-24
@@ -4,17 +4,15 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Filament\Resources\Wiki\Studio\RelationManagers;
|
||||
|
||||
use App\Filament\Resources\BaseRelationManager;
|
||||
use App\Filament\Resources\Wiki\ExternalResource as ExternalResourceResource;
|
||||
use App\Filament\RelationManagers\Wiki\ResourceRelationManager;
|
||||
use App\Models\Wiki\Studio;
|
||||
use App\Models\Wiki\ExternalResource;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Tables\Table;
|
||||
|
||||
/**
|
||||
* Class ResourceStudioRelationManager.
|
||||
*/
|
||||
class ResourceStudioRelationManager extends BaseRelationManager
|
||||
class ResourceStudioRelationManager extends ResourceRelationManager
|
||||
{
|
||||
/**
|
||||
* The relationship the relation manager corresponds to.
|
||||
@@ -23,19 +21,6 @@ class ResourceStudioRelationManager extends BaseRelationManager
|
||||
*/
|
||||
protected static string $relationship = Studio::RELATION_RESOURCES;
|
||||
|
||||
/**
|
||||
* The form to the actions.
|
||||
*
|
||||
* @param Form $form
|
||||
* @return Form
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public function form(Form $form): Form
|
||||
{
|
||||
return ExternalResourceResource::form($form);
|
||||
}
|
||||
|
||||
/**
|
||||
* The index page of the resource.
|
||||
*
|
||||
@@ -48,12 +33,7 @@ class ResourceStudioRelationManager extends BaseRelationManager
|
||||
{
|
||||
return parent::table(
|
||||
$table
|
||||
->heading(ExternalResourceResource::getPluralLabel())
|
||||
->modelLabel(ExternalResourceResource::getLabel())
|
||||
->recordTitleAttribute(ExternalResource::ATTRIBUTE_LINK)
|
||||
->inverseRelationship(ExternalResource::RELATION_STUDIOS)
|
||||
->columns(ExternalResourceResource::table($table)->getColumns())
|
||||
->defaultSort(ExternalResource::TABLE . '.' . ExternalResource::ATTRIBUTE_ID, 'desc')
|
||||
);
|
||||
}
|
||||
|
||||
@@ -67,8 +47,8 @@ class ResourceStudioRelationManager extends BaseRelationManager
|
||||
public static function getFilters(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getFilters(),
|
||||
[],
|
||||
parent::getFilters(),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -89,7 +69,7 @@ class ResourceStudioRelationManager extends BaseRelationManager
|
||||
|
||||
/**
|
||||
* Get the bulk actions available for the relation.
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
|
||||
@@ -323,8 +323,7 @@ class Video extends BaseResource
|
||||
return array_merge(
|
||||
[
|
||||
NumberFilter::make(VideoModel::ATTRIBUTE_RESOLUTION)
|
||||
->labels(__('filament.filters.video.resolution_from'), __('filament.filters.video.resolution_to'))
|
||||
->attribute(VideoModel::ATTRIBUTE_RESOLUTION),
|
||||
->labels(__('filament.filters.video.resolution_from'), __('filament.filters.video.resolution_to')),
|
||||
|
||||
Filter::make(VideoModel::ATTRIBUTE_NC)
|
||||
->label(__('filament.fields.video.nc.name'))
|
||||
@@ -351,8 +350,7 @@ class Video extends BaseResource
|
||||
->options(VideoSource::asSelectArray()),
|
||||
|
||||
NumberFilter::make(VideoModel::ATTRIBUTE_SIZE)
|
||||
->labels(__('filament.filters.video.size_from'), __('filament.filters.video.size_to'))
|
||||
->attribute(VideoModel::ATTRIBUTE_SIZE),
|
||||
->labels(__('filament.filters.video.size_from'), __('filament.filters.video.size_to')),
|
||||
],
|
||||
parent::getFilters(),
|
||||
);
|
||||
|
||||
@@ -4,17 +4,15 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Filament\Resources\Wiki\Video\RelationManagers;
|
||||
|
||||
use App\Filament\Resources\BaseRelationManager;
|
||||
use App\Filament\Resources\Wiki\Anime\Theme\Entry as EntryResource;
|
||||
use App\Filament\RelationManagers\Wiki\Anime\Theme\EntryRelationManager;
|
||||
use App\Models\Wiki\Video;
|
||||
use App\Models\Wiki\Anime\Theme\AnimeThemeEntry;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Tables\Table;
|
||||
|
||||
/**
|
||||
* Class EntryVideoRelationManager.
|
||||
*/
|
||||
class EntryVideoRelationManager extends BaseRelationManager
|
||||
class EntryVideoRelationManager extends EntryRelationManager
|
||||
{
|
||||
/**
|
||||
* The relationship the relation manager corresponds to.
|
||||
@@ -23,19 +21,6 @@ class EntryVideoRelationManager extends BaseRelationManager
|
||||
*/
|
||||
protected static string $relationship = Video::RELATION_ANIMETHEMEENTRIES;
|
||||
|
||||
/**
|
||||
* The form to the actions.
|
||||
*
|
||||
* @param Form $form
|
||||
* @return Form
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public function form(Form $form): Form
|
||||
{
|
||||
return EntryResource::form($form);
|
||||
}
|
||||
|
||||
/**
|
||||
* The index page of the resource.
|
||||
*
|
||||
@@ -48,12 +33,7 @@ class EntryVideoRelationManager extends BaseRelationManager
|
||||
{
|
||||
return parent::table(
|
||||
$table
|
||||
->heading(EntryResource::getPluralLabel())
|
||||
->modelLabel(EntryResource::getLabel())
|
||||
->recordTitleAttribute(AnimeThemeEntry::ATTRIBUTE_VERSION)
|
||||
->inverseRelationship(AnimeThemeEntry::RELATION_VIDEOS)
|
||||
->columns(EntryResource::table($table)->getColumns())
|
||||
->defaultSort(AnimeThemeEntry::TABLE . '.' . AnimeThemeEntry::ATTRIBUTE_ID, 'desc')
|
||||
);
|
||||
}
|
||||
|
||||
@@ -67,8 +47,8 @@ class EntryVideoRelationManager extends BaseRelationManager
|
||||
public static function getFilters(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getFilters(),
|
||||
[],
|
||||
parent::getFilters(),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -89,7 +69,7 @@ class EntryVideoRelationManager extends BaseRelationManager
|
||||
|
||||
/**
|
||||
* Get the bulk actions available for the relation.
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
|
||||
@@ -4,17 +4,15 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Filament\Resources\Wiki\Video\RelationManagers;
|
||||
|
||||
use App\Filament\Resources\BaseRelationManager;
|
||||
use App\Filament\Resources\Wiki\Video\Script as ScriptResource;
|
||||
use App\Filament\RelationManagers\Wiki\Video\ScriptRelationManager;
|
||||
use App\Models\Wiki\Video;
|
||||
use App\Models\Wiki\Video\VideoScript;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Tables\Table;
|
||||
|
||||
/**
|
||||
* Class ScriptVideoRelationManager.
|
||||
*/
|
||||
class ScriptVideoRelationManager extends BaseRelationManager
|
||||
class ScriptVideoRelationManager extends ScriptRelationManager
|
||||
{
|
||||
/**
|
||||
* The relationship the relation manager corresponds to.
|
||||
@@ -23,19 +21,6 @@ class ScriptVideoRelationManager extends BaseRelationManager
|
||||
*/
|
||||
protected static string $relationship = Video::RELATION_SCRIPT;
|
||||
|
||||
/**
|
||||
* The form to the actions.
|
||||
*
|
||||
* @param Form $form
|
||||
* @return Form
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public function form(Form $form): Form
|
||||
{
|
||||
return ScriptResource::form($form);
|
||||
}
|
||||
|
||||
/**
|
||||
* The index page of the resource.
|
||||
*
|
||||
@@ -48,11 +33,7 @@ class ScriptVideoRelationManager extends BaseRelationManager
|
||||
{
|
||||
return parent::table(
|
||||
$table
|
||||
->heading(ScriptResource::getLabel())
|
||||
->modelLabel(ScriptResource::getLabel())
|
||||
->recordTitleAttribute(VideoScript::ATTRIBUTE_PATH)
|
||||
->inverseRelationship(VideoScript::RELATION_VIDEO)
|
||||
->columns(ScriptResource::table($table)->getColumns())
|
||||
);
|
||||
}
|
||||
|
||||
@@ -66,8 +47,8 @@ class ScriptVideoRelationManager extends BaseRelationManager
|
||||
public static function getFilters(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getFilters(),
|
||||
[],
|
||||
parent::getFilters(),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -88,7 +69,7 @@ class ScriptVideoRelationManager extends BaseRelationManager
|
||||
|
||||
/**
|
||||
* Get the bulk actions available for the relation.
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
@@ -110,6 +91,9 @@ class ScriptVideoRelationManager extends BaseRelationManager
|
||||
*/
|
||||
public static function getHeaderActions(): array
|
||||
{
|
||||
return ScriptResource::getHeaderActions();
|
||||
return array_merge(
|
||||
parent::getHeaderActions(),
|
||||
[],
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -4,17 +4,15 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Filament\Resources\Wiki\Video\RelationManagers;
|
||||
|
||||
use App\Filament\Resources\BaseRelationManager;
|
||||
use App\Filament\Resources\List\Playlist\Track as TrackResource;
|
||||
use App\Filament\RelationManagers\List\Playlist\TrackRelationManager;
|
||||
use App\Models\Wiki\Video;
|
||||
use App\Models\List\Playlist\PlaylistTrack;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Tables\Table;
|
||||
|
||||
/**
|
||||
* Class TrackVideoRelationManager.
|
||||
*/
|
||||
class TrackVideoRelationManager extends BaseRelationManager
|
||||
class TrackVideoRelationManager extends TrackRelationManager
|
||||
{
|
||||
/**
|
||||
* The relationship the relation manager corresponds to.
|
||||
@@ -23,19 +21,6 @@ class TrackVideoRelationManager extends BaseRelationManager
|
||||
*/
|
||||
protected static string $relationship = Video::RELATION_TRACKS;
|
||||
|
||||
/**
|
||||
* The form to the actions.
|
||||
*
|
||||
* @param Form $form
|
||||
* @return Form
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public function form(Form $form): Form
|
||||
{
|
||||
return TrackResource::form($form);
|
||||
}
|
||||
|
||||
/**
|
||||
* The index page of the resource.
|
||||
*
|
||||
@@ -48,12 +33,7 @@ class TrackVideoRelationManager extends BaseRelationManager
|
||||
{
|
||||
return parent::table(
|
||||
$table
|
||||
->heading(TrackResource::getPluralLabel())
|
||||
->modelLabel(TrackResource::getLabel())
|
||||
->recordTitleAttribute(PlaylistTrack::ATTRIBUTE_HASHID)
|
||||
->inverseRelationship(PlaylistTrack::RELATION_VIDEO)
|
||||
->columns(TrackResource::table($table)->getColumns())
|
||||
->defaultSort(PlaylistTrack::TABLE . '.' . PlaylistTrack::ATTRIBUTE_ID, 'desc')
|
||||
);
|
||||
}
|
||||
|
||||
@@ -67,8 +47,8 @@ class TrackVideoRelationManager extends BaseRelationManager
|
||||
public static function getFilters(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getFilters(),
|
||||
[],
|
||||
parent::getFilters(),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -89,7 +69,7 @@ class TrackVideoRelationManager extends BaseRelationManager
|
||||
|
||||
/**
|
||||
* Get the bulk actions available for the relation.
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace App\Filament\TableActions\Storage\Wiki\Video\Script;
|
||||
|
||||
use App\Actions\Storage\Wiki\Video\Script\UploadScriptAction as UploadScript;
|
||||
use App\Constants\Config\VideoConstants;
|
||||
use App\Filament\Resources\BaseRelationManager;
|
||||
use App\Filament\RelationManagers\BaseRelationManager;
|
||||
use App\Filament\Resources\Wiki\Video\Script\Pages\ListScripts;
|
||||
use App\Models\Wiki\Video;
|
||||
use App\Filament\TableActions\Storage\Base\UploadTableAction;
|
||||
|
||||
@@ -10,7 +10,7 @@ use App\Enums\Models\Wiki\AnimeSeason;
|
||||
use App\Enums\Models\Wiki\VideoOverlap;
|
||||
use App\Enums\Models\Wiki\VideoSource;
|
||||
use App\Filament\Components\Fields\Select;
|
||||
use App\Filament\Resources\BaseRelationManager;
|
||||
use App\Filament\RelationManagers\BaseRelationManager;
|
||||
use App\Filament\Resources\Wiki\Video\Pages\ListVideos;
|
||||
use App\Models\Wiki\Anime\Theme\AnimeThemeEntry;
|
||||
use App\Models\Wiki\Video;
|
||||
|
||||
@@ -4,7 +4,6 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Filament\Widgets;
|
||||
|
||||
use App\Models\BaseModel;
|
||||
use Flowframe\Trend\Trend;
|
||||
use Illuminate\Support\Collection;
|
||||
use Leandrocfe\FilamentApexCharts\Widgets\ApexChartWidget;
|
||||
@@ -14,6 +13,8 @@ use Leandrocfe\FilamentApexCharts\Widgets\ApexChartWidget;
|
||||
*/
|
||||
class BaseChartWidget extends ApexChartWidget
|
||||
{
|
||||
protected static bool $isLazy = false;
|
||||
|
||||
/**
|
||||
* Get the resources count created per month.
|
||||
*
|
||||
|
||||
@@ -11,4 +11,5 @@ use Filament\Widgets\StatsOverviewWidget;
|
||||
*/
|
||||
class BaseStatsWidget extends StatsOverviewWidget
|
||||
{
|
||||
protected static bool $isLazy = false;
|
||||
}
|
||||
@@ -12,6 +12,7 @@ use App\Models\Discord\DiscordThread;
|
||||
use App\Models\Wiki\Anime;
|
||||
use Illuminate\Support\Facades\Bus;
|
||||
use Illuminate\Support\Facades\Event;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use Laravel\Pennant\Feature;
|
||||
use Tests\TestCase;
|
||||
|
||||
@@ -33,6 +34,7 @@ class DiscordThreadTest extends TestCase
|
||||
|
||||
Feature::activate(FeatureConstants::ALLOW_DISCORD_NOTIFICATIONS);
|
||||
Bus::fake(SendDiscordNotificationJob::class);
|
||||
Http::fake();
|
||||
Event::fakeExcept(DiscordThreadDeleted::class);
|
||||
|
||||
$thread->delete();
|
||||
@@ -53,6 +55,7 @@ class DiscordThreadTest extends TestCase
|
||||
|
||||
Feature::activate(FeatureConstants::ALLOW_DISCORD_NOTIFICATIONS);
|
||||
Bus::fake(SendDiscordNotificationJob::class);
|
||||
Http::fake();
|
||||
Event::fakeExcept(DiscordThreadUpdated::class);
|
||||
|
||||
$changes = DiscordThread::factory()
|
||||
|
||||
Reference in new issue
Block a user