mirror of
https://github.com/AnimeThemes/animethemes-server.git
synced 2026-07-11 01:24:46 +02:00
refactor: migrate from create/list filament pages to simple modals (#793)
This commit is contained in:
@@ -7,6 +7,10 @@ namespace App\Filament\Actions\Base;
|
||||
use App\Concerns\Filament\ActionLogs\HasPivotActionLogs;
|
||||
use App\Filament\Components\Fields\Select;
|
||||
use App\Filament\RelationManagers\BaseRelationManager;
|
||||
use App\Models\Wiki\ExternalResource;
|
||||
use App\Models\Wiki\Image;
|
||||
use Filament\Facades\Filament;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Tables\Actions\AttachAction as DefaultAttachAction;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
@@ -51,10 +55,20 @@ class AttachAction extends DefaultAttachAction
|
||||
/** @var string */
|
||||
$model = $livewire->getTable()->getModel();
|
||||
$title = $livewire->getTable()->getRecordTitle(new $model);
|
||||
return Select::make('recordId')
|
||||
|
||||
$select = Select::make('recordId')
|
||||
->label($title)
|
||||
->useScout($livewire, $model)
|
||||
->required();
|
||||
|
||||
if ($this->shouldShowCreateOption($model)) {
|
||||
$select = $select
|
||||
->createOptionForm(fn (Form $form) => Filament::getModelResource($model)::form($form)->getComponents())
|
||||
->createOptionUsing(fn (array $data) => $model::query()->create($data)->getKey());
|
||||
}
|
||||
|
||||
return $select;
|
||||
|
||||
});
|
||||
|
||||
$this->form(fn (AttachAction $action, BaseRelationManager $livewire): array => [
|
||||
@@ -64,4 +78,15 @@ class AttachAction extends DefaultAttachAction
|
||||
|
||||
$this->after(fn ($livewire, $record) => $this->pivotActionLog('Attach', $livewire, $record));
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine wheter the create option should be shown.
|
||||
*
|
||||
* @param string $model
|
||||
* @return bool
|
||||
*/
|
||||
private function shouldShowCreateOption(string $model): bool
|
||||
{
|
||||
return !($model === Image::class || $model === ExternalResource::class);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,9 +41,6 @@ class CreateAction extends DefaultCreateAction
|
||||
$this->after(function ($livewire, $record) {
|
||||
if ($livewire instanceof BaseRelationManager) {
|
||||
$relationship = $livewire->getRelationship();
|
||||
if ($relationship instanceof BelongsToMany) {
|
||||
$this->pivotActionLog('Create and Attach', $livewire, $record);
|
||||
}
|
||||
|
||||
if ($relationship instanceof HasMany) {
|
||||
$this->associateActionLog('Create and Associate', $livewire, $record);
|
||||
@@ -58,13 +55,15 @@ class CreateAction extends DefaultCreateAction
|
||||
return $user->hasRole(Role::ADMIN->value);
|
||||
}
|
||||
|
||||
if ($livewire->getRelationship() instanceof BelongsToMany) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$ownerRecord = $livewire->getOwnerRecord();
|
||||
|
||||
$gate = Gate::getPolicyFor($ownerRecord);
|
||||
|
||||
$method = $livewire->getRelationship() instanceof BelongsToMany ? 'attachAny' : 'addAny';
|
||||
|
||||
$ability = Str::of($method)
|
||||
$ability = Str::of('addAny')
|
||||
->append(Str::singular(class_basename($livewire->getTable()->getModel())))
|
||||
->__toString();
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ namespace App\Filament\Actions\Base;
|
||||
|
||||
use App\Concerns\Filament\ActionLogs\HasPivotActionLogs;
|
||||
use App\Filament\RelationManagers\BaseRelationManager;
|
||||
use App\Filament\Resources\Base\BaseListResources;
|
||||
use App\Filament\Resources\Base\BaseManageResources;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Support\Enums\IconSize;
|
||||
@@ -31,7 +32,7 @@ class EditAction extends DefaultEditAction
|
||||
$this->label('');
|
||||
$this->iconSize(IconSize::Medium);
|
||||
|
||||
$this->form(fn (Form $form, BaseRelationManager|BaseManageResources $livewire) => [
|
||||
$this->form(fn (Form $form, BaseRelationManager|BaseManageResources|BaseListResources $livewire) => [
|
||||
...$livewire->form($form)->getComponents(),
|
||||
...($livewire instanceof BaseRelationManager ? $livewire->getPivotFields() : []),
|
||||
]);
|
||||
|
||||
@@ -4,7 +4,9 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Filament\HeaderActions\Base;
|
||||
|
||||
use App\Models\Admin\ActionLog;
|
||||
use Filament\Actions\CreateAction as DefaultCreateAction;
|
||||
use Filament\Facades\Filament;
|
||||
|
||||
/**
|
||||
* Class CreateHeaderAction.
|
||||
@@ -19,5 +21,8 @@ class CreateHeaderAction extends DefaultCreateAction
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
$this->successRedirectUrl(fn ($record) => Filament::getModelResource($record)::getUrl('view', ['record' => $record]));
|
||||
$this->after(fn ($record) => ActionLog::modelCreated($record));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Filament\HeaderActions\Base;
|
||||
|
||||
use App\Models\Admin\ActionLog;
|
||||
use Filament\Actions\EditAction as DefaultEditAction;
|
||||
|
||||
/**
|
||||
@@ -22,5 +23,6 @@ class EditHeaderAction extends DefaultEditAction
|
||||
|
||||
$this->label(__('filament.actions.base.edit'));
|
||||
$this->icon(__('filament-icons.actions.base.edit'));
|
||||
$this->after(fn ($record) => ActionLog::modelUpdated($record));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,10 +57,9 @@ abstract class ReportStepRelationManager extends BaseRelationManager
|
||||
*/
|
||||
public static function getFilters(): array
|
||||
{
|
||||
return array_merge(
|
||||
[],
|
||||
ReportStepResource::getFilters(),
|
||||
);
|
||||
return [
|
||||
...ReportStepResource::getFilters(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -70,10 +69,10 @@ abstract class ReportStepRelationManager extends BaseRelationManager
|
||||
*/
|
||||
public static function getActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getActions(),
|
||||
ReportStepResource::getActions(),
|
||||
);
|
||||
return [
|
||||
...parent::getActions(),
|
||||
...ReportStepResource::getActions(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -84,22 +83,23 @@ abstract class ReportStepRelationManager extends BaseRelationManager
|
||||
*/
|
||||
public static function getBulkActions(?array $actionsIncludedInGroup = []): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getBulkActions(),
|
||||
ReportStepResource::getBulkActions(),
|
||||
);
|
||||
return [
|
||||
...parent::getBulkActions(),
|
||||
...ReportStepResource::getBulkActions(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the header actions available for the relation. These are merged with the table actions of the resources.
|
||||
* Get the header actions available for the relation.
|
||||
* These are merged with the table actions of the resources.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getHeaderActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getHeaderActions(),
|
||||
ReportStepResource::getTableActions(),
|
||||
);
|
||||
return [
|
||||
...parent::getHeaderActions(),
|
||||
...ReportStepResource::getTableActions(),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,10 +57,9 @@ abstract class PermissionRelationManager extends BaseRelationManager
|
||||
*/
|
||||
public static function getFilters(): array
|
||||
{
|
||||
return array_merge(
|
||||
[],
|
||||
PermissionResource::getFilters(),
|
||||
);
|
||||
return [
|
||||
...PermissionResource::getFilters(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -83,10 +82,10 @@ abstract class PermissionRelationManager extends BaseRelationManager
|
||||
*/
|
||||
public static function getBulkActions(?array $actionsIncludedInGroup = []): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getBulkActions(),
|
||||
PermissionResource::getBulkActions(),
|
||||
);
|
||||
return [
|
||||
...parent::getBulkActions(),
|
||||
...PermissionResource::getBulkActions(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -58,10 +58,9 @@ abstract class RoleRelationManager extends BaseRelationManager
|
||||
*/
|
||||
public static function getFilters(): array
|
||||
{
|
||||
return array_merge(
|
||||
[],
|
||||
RoleResource::getFilters(),
|
||||
);
|
||||
return [
|
||||
...RoleResource::getFilters(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -86,10 +85,10 @@ abstract class RoleRelationManager extends BaseRelationManager
|
||||
*/
|
||||
public static function getBulkActions(?array $actionsIncludedInGroup = []): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getBulkActions(),
|
||||
RoleResource::getBulkActions(),
|
||||
);
|
||||
return [
|
||||
...parent::getBulkActions(),
|
||||
...RoleResource::getBulkActions(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -57,10 +57,9 @@ abstract class UserRelationManager extends BaseRelationManager
|
||||
*/
|
||||
public static function getFilters(): array
|
||||
{
|
||||
return array_merge(
|
||||
[],
|
||||
UserResource::getFilters(),
|
||||
);
|
||||
return [
|
||||
...UserResource::getFilters(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -70,10 +69,10 @@ abstract class UserRelationManager extends BaseRelationManager
|
||||
*/
|
||||
public static function getActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getActions(),
|
||||
UserResource::getActions(),
|
||||
);
|
||||
return [
|
||||
...parent::getActions(),
|
||||
...UserResource::getActions(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -84,10 +83,10 @@ abstract class UserRelationManager extends BaseRelationManager
|
||||
*/
|
||||
public static function getBulkActions(?array $actionsIncludedInGroup = []): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getBulkActions(),
|
||||
UserResource::getBulkActions(),
|
||||
);
|
||||
return [
|
||||
...parent::getBulkActions(),
|
||||
...UserResource::getBulkActions(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+17
-17
@@ -57,10 +57,9 @@ abstract class ExternalEntryRelationManager extends BaseRelationManager
|
||||
*/
|
||||
public static function getFilters(): array
|
||||
{
|
||||
return array_merge(
|
||||
[],
|
||||
ExternalEntryResource::getFilters(),
|
||||
);
|
||||
return [
|
||||
...ExternalEntryResource::getFilters(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -70,10 +69,10 @@ abstract class ExternalEntryRelationManager extends BaseRelationManager
|
||||
*/
|
||||
public static function getActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getActions(),
|
||||
ExternalEntryResource::getActions(),
|
||||
);
|
||||
return [
|
||||
...parent::getActions(),
|
||||
...ExternalEntryResource::getActions(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -84,22 +83,23 @@ abstract class ExternalEntryRelationManager extends BaseRelationManager
|
||||
*/
|
||||
public static function getBulkActions(?array $actionsIncludedInGroup = []): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getBulkActions(),
|
||||
ExternalEntryResource::getBulkActions(),
|
||||
);
|
||||
return [
|
||||
...parent::getBulkActions(),
|
||||
...ExternalEntryResource::getBulkActions(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the header actions available for the relation. These are merged with the table actions of the resources.
|
||||
* Get the header actions available for the relation.
|
||||
* These are merged with the table actions of the resources.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getHeaderActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getHeaderActions(),
|
||||
ExternalEntryResource::getTableActions(),
|
||||
);
|
||||
return [
|
||||
...parent::getHeaderActions(),
|
||||
...ExternalEntryResource::getTableActions(),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,10 +57,9 @@ abstract class ExternalProfileRelationManager extends BaseRelationManager
|
||||
*/
|
||||
public static function getFilters(): array
|
||||
{
|
||||
return array_merge(
|
||||
[],
|
||||
ExternalProfileResource::getFilters(),
|
||||
);
|
||||
return [
|
||||
...ExternalProfileResource::getFilters(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -70,10 +69,10 @@ abstract class ExternalProfileRelationManager extends BaseRelationManager
|
||||
*/
|
||||
public static function getActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getActions(),
|
||||
ExternalProfileResource::getActions(),
|
||||
);
|
||||
return [
|
||||
...parent::getActions(),
|
||||
...ExternalProfileResource::getActions(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -84,22 +83,23 @@ abstract class ExternalProfileRelationManager extends BaseRelationManager
|
||||
*/
|
||||
public static function getBulkActions(?array $actionsIncludedInGroup = []): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getBulkActions(),
|
||||
ExternalProfileResource::getBulkActions(),
|
||||
);
|
||||
return [
|
||||
...parent::getBulkActions(),
|
||||
...ExternalProfileResource::getBulkActions(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the header actions available for the relation. These are merged with the table actions of the resources.
|
||||
* Get the header actions available for the relation.
|
||||
* These are merged with the table actions of the resources.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getHeaderActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getHeaderActions(),
|
||||
ExternalProfileResource::getTableActions(),
|
||||
);
|
||||
return [
|
||||
...parent::getHeaderActions(),
|
||||
...ExternalProfileResource::getTableActions(),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,10 +57,9 @@ abstract class TrackRelationManager extends BaseRelationManager
|
||||
*/
|
||||
public static function getFilters(): array
|
||||
{
|
||||
return array_merge(
|
||||
[],
|
||||
TrackResource::getFilters(),
|
||||
);
|
||||
return [
|
||||
...TrackResource::getFilters(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -70,10 +69,10 @@ abstract class TrackRelationManager extends BaseRelationManager
|
||||
*/
|
||||
public static function getActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getActions(),
|
||||
TrackResource::getActions(),
|
||||
);
|
||||
return [
|
||||
...parent::getActions(),
|
||||
...TrackResource::getActions(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -84,22 +83,23 @@ abstract class TrackRelationManager extends BaseRelationManager
|
||||
*/
|
||||
public static function getBulkActions(?array $actionsIncludedInGroup = []): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getBulkActions(),
|
||||
TrackResource::getBulkActions(),
|
||||
);
|
||||
return [
|
||||
...parent::getBulkActions(),
|
||||
...TrackResource::getBulkActions(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the header actions available for the relation. These are merged with the table actions of the resources.
|
||||
* Get the header actions available for the relation.
|
||||
* These are merged with the table actions of the resources.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getHeaderActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getHeaderActions(),
|
||||
TrackResource::getTableActions(),
|
||||
);
|
||||
return [
|
||||
...parent::getHeaderActions(),
|
||||
...TrackResource::getTableActions(),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,10 +57,9 @@ abstract class PlaylistRelationManager extends BaseRelationManager
|
||||
*/
|
||||
public static function getFilters(): array
|
||||
{
|
||||
return array_merge(
|
||||
[],
|
||||
PlaylistResource::getFilters(),
|
||||
);
|
||||
return [
|
||||
...PlaylistResource::getFilters(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -70,10 +69,10 @@ abstract class PlaylistRelationManager extends BaseRelationManager
|
||||
*/
|
||||
public static function getActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getActions(),
|
||||
PlaylistResource::getActions(),
|
||||
);
|
||||
return [
|
||||
...parent::getActions(),
|
||||
...PlaylistResource::getActions(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -84,22 +83,23 @@ abstract class PlaylistRelationManager extends BaseRelationManager
|
||||
*/
|
||||
public static function getBulkActions(?array $actionsIncludedInGroup = []): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getBulkActions(),
|
||||
PlaylistResource::getBulkActions(),
|
||||
);
|
||||
return [
|
||||
...parent::getBulkActions(),
|
||||
...PlaylistResource::getBulkActions(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the header actions available for the relation. These are merged with the table actions of the resources.
|
||||
* Get the header actions available for the relation.
|
||||
* These are merged with the table actions of the resources.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getHeaderActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getHeaderActions(),
|
||||
PlaylistResource::getTableActions(),
|
||||
);
|
||||
return [
|
||||
...parent::getHeaderActions(),
|
||||
...PlaylistResource::getTableActions(),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,10 +57,9 @@ abstract class SynonymRelationManager extends BaseRelationManager
|
||||
*/
|
||||
public static function getFilters(): array
|
||||
{
|
||||
return array_merge(
|
||||
[],
|
||||
SynonymResource::getFilters(),
|
||||
);
|
||||
return [
|
||||
...SynonymResource::getFilters(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -70,10 +69,10 @@ abstract class SynonymRelationManager extends BaseRelationManager
|
||||
*/
|
||||
public static function getActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getActions(),
|
||||
SynonymResource::getActions(),
|
||||
);
|
||||
return [
|
||||
...parent::getActions(),
|
||||
...SynonymResource::getActions(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -84,22 +83,23 @@ abstract class SynonymRelationManager extends BaseRelationManager
|
||||
*/
|
||||
public static function getBulkActions(?array $actionsIncludedInGroup = []): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getBulkActions(),
|
||||
SynonymResource::getBulkActions(),
|
||||
);
|
||||
return [
|
||||
...parent::getBulkActions(),
|
||||
...SynonymResource::getBulkActions(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the header actions available for the relation. These are merged with the table actions of the resources.
|
||||
* Get the header actions available for the relation.
|
||||
* These are merged with the table actions of the resources.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getHeaderActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getHeaderActions(),
|
||||
SynonymResource::getTableActions(),
|
||||
);
|
||||
return [
|
||||
...parent::getHeaderActions(),
|
||||
...SynonymResource::getTableActions(),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,10 +57,9 @@ abstract class EntryRelationManager extends BaseRelationManager
|
||||
*/
|
||||
public static function getFilters(): array
|
||||
{
|
||||
return array_merge(
|
||||
[],
|
||||
EntryResource::getFilters(),
|
||||
);
|
||||
return [
|
||||
...EntryResource::getFilters(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -70,10 +69,10 @@ abstract class EntryRelationManager extends BaseRelationManager
|
||||
*/
|
||||
public static function getActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getActions(),
|
||||
EntryResource::getActions(),
|
||||
);
|
||||
return [
|
||||
...parent::getActions(),
|
||||
...EntryResource::getActions(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -84,22 +83,23 @@ abstract class EntryRelationManager extends BaseRelationManager
|
||||
*/
|
||||
public static function getBulkActions(?array $actionsIncludedInGroup = []): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getBulkActions(),
|
||||
EntryResource::getBulkActions(),
|
||||
);
|
||||
return [
|
||||
...parent::getBulkActions(),
|
||||
...EntryResource::getBulkActions(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the header actions available for the relation. These are merged with the table actions of the resources.
|
||||
* Get the header actions available for the relation.
|
||||
* These are merged with the table actions of the resources.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getHeaderActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getHeaderActions(),
|
||||
EntryResource::getTableActions(),
|
||||
);
|
||||
return [
|
||||
...parent::getHeaderActions(),
|
||||
...EntryResource::getTableActions(),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,10 +57,9 @@ abstract class ThemeRelationManager extends BaseRelationManager
|
||||
*/
|
||||
public static function getFilters(): array
|
||||
{
|
||||
return array_merge(
|
||||
[],
|
||||
ThemeResource::getFilters(),
|
||||
);
|
||||
return [
|
||||
...ThemeResource::getFilters(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -70,10 +69,10 @@ abstract class ThemeRelationManager extends BaseRelationManager
|
||||
*/
|
||||
public static function getActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getActions(),
|
||||
ThemeResource::getActions(),
|
||||
);
|
||||
return [
|
||||
...parent::getActions(),
|
||||
...ThemeResource::getActions(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -84,22 +83,23 @@ abstract class ThemeRelationManager extends BaseRelationManager
|
||||
*/
|
||||
public static function getBulkActions(?array $actionsIncludedInGroup = []): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getBulkActions(),
|
||||
ThemeResource::getBulkActions(),
|
||||
);
|
||||
return [
|
||||
...parent::getBulkActions(),
|
||||
...ThemeResource::getBulkActions(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the header actions available for the relation. These are merged with the table actions of the resources.
|
||||
* Get the header actions available for the relation.
|
||||
* These are merged with the table actions of the resources.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getHeaderActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getHeaderActions(),
|
||||
ThemeResource::getTableActions(),
|
||||
);
|
||||
return [
|
||||
...parent::getHeaderActions(),
|
||||
...ThemeResource::getTableActions(),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,10 +57,9 @@ abstract class AnimeRelationManager extends BaseRelationManager
|
||||
*/
|
||||
public static function getFilters(): array
|
||||
{
|
||||
return array_merge(
|
||||
[],
|
||||
AnimeResource::getFilters(),
|
||||
);
|
||||
return [
|
||||
...AnimeResource::getFilters(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -70,10 +69,10 @@ abstract class AnimeRelationManager extends BaseRelationManager
|
||||
*/
|
||||
public static function getActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getActions(),
|
||||
AnimeResource::getActions(),
|
||||
);
|
||||
return [
|
||||
...parent::getActions(),
|
||||
...AnimeResource::getActions(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -84,22 +83,23 @@ abstract class AnimeRelationManager extends BaseRelationManager
|
||||
*/
|
||||
public static function getBulkActions(?array $actionsIncludedInGroup = []): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getBulkActions(),
|
||||
AnimeResource::getBulkActions(),
|
||||
);
|
||||
return [
|
||||
...parent::getBulkActions(),
|
||||
...AnimeResource::getBulkActions(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the header actions available for the relation. These are merged with the table actions of the resources.
|
||||
* Get the header actions available for the relation.
|
||||
* These are merged with the table actions of the resources.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getHeaderActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getHeaderActions(),
|
||||
AnimeResource::getTableActions(),
|
||||
);
|
||||
return [
|
||||
...parent::getHeaderActions(),
|
||||
...AnimeResource::getTableActions(),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,10 +57,9 @@ abstract class ArtistRelationManager extends BaseRelationManager
|
||||
*/
|
||||
public static function getFilters(): array
|
||||
{
|
||||
return array_merge(
|
||||
[],
|
||||
ArtistResource::getFilters(),
|
||||
);
|
||||
return [
|
||||
...ArtistResource::getFilters(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -70,10 +69,10 @@ abstract class ArtistRelationManager extends BaseRelationManager
|
||||
*/
|
||||
public static function getActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getActions(),
|
||||
ArtistResource::getActions(),
|
||||
);
|
||||
return [
|
||||
...parent::getActions(),
|
||||
...ArtistResource::getActions(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -84,22 +83,23 @@ abstract class ArtistRelationManager extends BaseRelationManager
|
||||
*/
|
||||
public static function getBulkActions(?array $actionsIncludedInGroup = []): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getBulkActions(),
|
||||
ArtistResource::getBulkActions(),
|
||||
);
|
||||
return [
|
||||
...parent::getBulkActions(),
|
||||
...ArtistResource::getBulkActions(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the header actions available for the relation. These are merged with the table actions of the resources.
|
||||
* Get the header actions available for the relation.
|
||||
* These are merged with the table actions of the resources.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getHeaderActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getHeaderActions(),
|
||||
ArtistResource::getTableActions(),
|
||||
);
|
||||
return [
|
||||
...parent::getHeaderActions(),
|
||||
...ArtistResource::getTableActions(),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,10 +58,9 @@ abstract class ImageRelationManager extends BaseRelationManager
|
||||
*/
|
||||
public static function getFilters(): array
|
||||
{
|
||||
return array_merge(
|
||||
[],
|
||||
ImageResource::getFilters(),
|
||||
);
|
||||
return [
|
||||
...ImageResource::getFilters(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -71,10 +70,10 @@ abstract class ImageRelationManager extends BaseRelationManager
|
||||
*/
|
||||
public static function getActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getActions(),
|
||||
ImageResource::getActions(),
|
||||
);
|
||||
return [
|
||||
...parent::getActions(),
|
||||
...ImageResource::getActions(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -85,24 +84,26 @@ abstract class ImageRelationManager extends BaseRelationManager
|
||||
*/
|
||||
public static function getBulkActions(?array $actionsIncludedInGroup = []): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getBulkActions(),
|
||||
ImageResource::getBulkActions(),
|
||||
);
|
||||
return [
|
||||
...parent::getBulkActions(),
|
||||
...ImageResource::getBulkActions(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the header actions available for the relation. These are merged with the table actions of the resources.
|
||||
* Get the header actions available for the relation.
|
||||
* These are merged with the table actions of the resources.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getHeaderActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getHeaderActions(),
|
||||
ImageResource::getTableActions(),
|
||||
[AttachImageAction::make('attachimage')],
|
||||
);
|
||||
return [
|
||||
...parent::getHeaderActions(),
|
||||
...ImageResource::getTableActions(),
|
||||
|
||||
AttachImageAction::make('attachimage'),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -74,10 +74,9 @@ abstract class ResourceRelationManager extends BaseRelationManager
|
||||
*/
|
||||
public static function getFilters(): array
|
||||
{
|
||||
return array_merge(
|
||||
[],
|
||||
ExternalResourceResource::getFilters(),
|
||||
);
|
||||
return [
|
||||
...ExternalResourceResource::getFilters(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -87,10 +86,10 @@ abstract class ResourceRelationManager extends BaseRelationManager
|
||||
*/
|
||||
public static function getActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getActions(),
|
||||
ExternalResourceResource::getActions(),
|
||||
);
|
||||
return [
|
||||
...parent::getActions(),
|
||||
...ExternalResourceResource::getActions(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -101,22 +100,23 @@ abstract class ResourceRelationManager extends BaseRelationManager
|
||||
*/
|
||||
public static function getBulkActions(?array $actionsIncludedInGroup = []): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getBulkActions(),
|
||||
ExternalResourceResource::getBulkActions(),
|
||||
);
|
||||
return [
|
||||
...parent::getBulkActions(),
|
||||
...ExternalResourceResource::getBulkActions(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the header actions available for the relation. These are merged with the table actions of the resources.
|
||||
* Get the header actions available for the relation.
|
||||
* These are merged with the table actions of the resources.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getHeaderActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getHeaderActions(),
|
||||
ExternalResourceResource::getTableActions(),
|
||||
);
|
||||
return [
|
||||
...parent::getHeaderActions(),
|
||||
...ExternalResourceResource::getTableActions(),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,10 +57,9 @@ abstract class SeriesRelationManager extends BaseRelationManager
|
||||
*/
|
||||
public static function getFilters(): array
|
||||
{
|
||||
return array_merge(
|
||||
[],
|
||||
SeriesResource::getFilters(),
|
||||
);
|
||||
return [
|
||||
...SeriesResource::getFilters(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -70,10 +69,10 @@ abstract class SeriesRelationManager extends BaseRelationManager
|
||||
*/
|
||||
public static function getActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getActions(),
|
||||
SeriesResource::getActions(),
|
||||
);
|
||||
return [
|
||||
...parent::getActions(),
|
||||
...SeriesResource::getActions(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -84,22 +83,23 @@ abstract class SeriesRelationManager extends BaseRelationManager
|
||||
*/
|
||||
public static function getBulkActions(?array $actionsIncludedInGroup = []): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getBulkActions(),
|
||||
SeriesResource::getBulkActions(),
|
||||
);
|
||||
return [
|
||||
...parent::getBulkActions(),
|
||||
...SeriesResource::getBulkActions(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the header actions available for the relation. These are merged with the table actions of the resources.
|
||||
* Get the header actions available for the relation.
|
||||
* These are merged with the table actions of the resources.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getHeaderActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getHeaderActions(),
|
||||
SeriesResource::getTableActions(),
|
||||
);
|
||||
return [
|
||||
...parent::getHeaderActions(),
|
||||
...SeriesResource::getTableActions(),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,10 +57,9 @@ abstract class PerformanceRelationManager extends BaseRelationManager
|
||||
*/
|
||||
public static function getFilters(): array
|
||||
{
|
||||
return array_merge(
|
||||
[],
|
||||
PerformanceResource::getFilters(),
|
||||
);
|
||||
return [
|
||||
...PerformanceResource::getFilters(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -70,10 +69,10 @@ abstract class PerformanceRelationManager extends BaseRelationManager
|
||||
*/
|
||||
public static function getActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getActions(),
|
||||
PerformanceResource::getActions(),
|
||||
);
|
||||
return [
|
||||
...parent::getActions(),
|
||||
...PerformanceResource::getActions(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -84,22 +83,23 @@ abstract class PerformanceRelationManager extends BaseRelationManager
|
||||
*/
|
||||
public static function getBulkActions(?array $actionsIncludedInGroup = []): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getBulkActions(),
|
||||
PerformanceResource::getBulkActions(),
|
||||
);
|
||||
return [
|
||||
...parent::getBulkActions(),
|
||||
...PerformanceResource::getBulkActions(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the header actions available for the relation. These are merged with the table actions of the resources.
|
||||
* Get the header actions available for the relation.
|
||||
* These are merged with the table actions of the resources.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getHeaderActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getHeaderActions(),
|
||||
PerformanceResource::getTableActions(),
|
||||
);
|
||||
return [
|
||||
...parent::getHeaderActions(),
|
||||
...PerformanceResource::getTableActions(),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,10 +57,9 @@ abstract class SongRelationManager extends BaseRelationManager
|
||||
*/
|
||||
public static function getFilters(): array
|
||||
{
|
||||
return array_merge(
|
||||
[],
|
||||
SongResource::getFilters(),
|
||||
);
|
||||
return [
|
||||
...SongResource::getFilters(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -70,10 +69,10 @@ abstract class SongRelationManager extends BaseRelationManager
|
||||
*/
|
||||
public static function getActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getActions(),
|
||||
SongResource::getActions(),
|
||||
);
|
||||
return [
|
||||
...parent::getActions(),
|
||||
...SongResource::getActions(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -84,22 +83,23 @@ abstract class SongRelationManager extends BaseRelationManager
|
||||
*/
|
||||
public static function getBulkActions(?array $actionsIncludedInGroup = []): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getBulkActions(),
|
||||
SongResource::getBulkActions(),
|
||||
);
|
||||
return [
|
||||
...parent::getBulkActions(),
|
||||
...SongResource::getBulkActions(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the header actions available for the relation. These are merged with the table actions of the resources.
|
||||
* Get the header actions available for the relation.
|
||||
* These are merged with the table actions of the resources.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getHeaderActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getHeaderActions(),
|
||||
SongResource::getTableActions(),
|
||||
);
|
||||
return [
|
||||
...parent::getHeaderActions(),
|
||||
...SongResource::getTableActions(),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,10 +57,9 @@ abstract class StudioRelationManager extends BaseRelationManager
|
||||
*/
|
||||
public static function getFilters(): array
|
||||
{
|
||||
return array_merge(
|
||||
[],
|
||||
StudioResource::getFilters(),
|
||||
);
|
||||
return [
|
||||
...StudioResource::getFilters(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -70,10 +69,10 @@ abstract class StudioRelationManager extends BaseRelationManager
|
||||
*/
|
||||
public static function getActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getActions(),
|
||||
StudioResource::getActions(),
|
||||
);
|
||||
return [
|
||||
...parent::getActions(),
|
||||
...StudioResource::getActions(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -84,22 +83,23 @@ abstract class StudioRelationManager extends BaseRelationManager
|
||||
*/
|
||||
public static function getBulkActions(?array $actionsIncludedInGroup = []): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getBulkActions(),
|
||||
StudioResource::getBulkActions(),
|
||||
);
|
||||
return [
|
||||
...parent::getBulkActions(),
|
||||
...StudioResource::getBulkActions(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the header actions available for the relation. These are merged with the table actions of the resources.
|
||||
* Get the header actions available for the relation.
|
||||
* These are merged with the table actions of the resources.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getHeaderActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getHeaderActions(),
|
||||
StudioResource::getTableActions(),
|
||||
);
|
||||
return [
|
||||
...parent::getHeaderActions(),
|
||||
...StudioResource::getTableActions(),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,10 +57,9 @@ abstract class ScriptRelationManager extends BaseRelationManager
|
||||
*/
|
||||
public static function getFilters(): array
|
||||
{
|
||||
return array_merge(
|
||||
[],
|
||||
ScriptResource::getFilters(),
|
||||
);
|
||||
return [
|
||||
...ScriptResource::getFilters(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -70,10 +69,10 @@ abstract class ScriptRelationManager extends BaseRelationManager
|
||||
*/
|
||||
public static function getActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getActions(),
|
||||
ScriptResource::getActions(),
|
||||
);
|
||||
return [
|
||||
...parent::getActions(),
|
||||
...ScriptResource::getActions(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -84,23 +83,24 @@ abstract class ScriptRelationManager extends BaseRelationManager
|
||||
*/
|
||||
public static function getBulkActions(?array $actionsIncludedInGroup = []): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getBulkActions(),
|
||||
ScriptResource::getBulkActions(),
|
||||
);
|
||||
return [
|
||||
...parent::getBulkActions(),
|
||||
...ScriptResource::getBulkActions(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the header actions available for the relation. These are merged with the table actions of the resources.
|
||||
* Get the header actions available for the relation.
|
||||
* These are merged with the table actions of the resources.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getHeaderActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getHeaderActions(),
|
||||
ScriptResource::getTableActions(),
|
||||
);
|
||||
return [
|
||||
...parent::getHeaderActions(),
|
||||
...ScriptResource::getTableActions(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -57,10 +57,9 @@ abstract class VideoRelationManager extends BaseRelationManager
|
||||
*/
|
||||
public static function getFilters(): array
|
||||
{
|
||||
return array_merge(
|
||||
[],
|
||||
VideoResource::getFilters(),
|
||||
);
|
||||
return [
|
||||
...VideoResource::getFilters(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -70,10 +69,10 @@ abstract class VideoRelationManager extends BaseRelationManager
|
||||
*/
|
||||
public static function getActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getActions(),
|
||||
VideoResource::getActions(),
|
||||
);
|
||||
return [
|
||||
...parent::getActions(),
|
||||
...VideoResource::getActions(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -84,23 +83,24 @@ abstract class VideoRelationManager extends BaseRelationManager
|
||||
*/
|
||||
public static function getBulkActions(?array $actionsIncludedInGroup = []): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getBulkActions(),
|
||||
VideoResource::getBulkActions(),
|
||||
);
|
||||
return [
|
||||
...parent::getBulkActions(),
|
||||
...VideoResource::getBulkActions(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the header actions available for the relation. These are merged with the table actions of the resources.
|
||||
* Get the header actions available for the relation.
|
||||
* These are merged with the table actions of the resources.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getHeaderActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getHeaderActions(),
|
||||
VideoResource::getTableActions(),
|
||||
);
|
||||
return [
|
||||
...parent::getHeaderActions(),
|
||||
...VideoResource::getTableActions(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -93,8 +93,6 @@ class ActionLog extends BaseResource
|
||||
* Get the slug (URI key) for the resource.
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public static function getRecordSlug(): string
|
||||
{
|
||||
@@ -258,10 +256,9 @@ class ActionLog extends BaseResource
|
||||
*/
|
||||
public static function getActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getActions(),
|
||||
[],
|
||||
);
|
||||
return [
|
||||
...parent::getActions(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -272,10 +269,9 @@ class ActionLog extends BaseResource
|
||||
*/
|
||||
public static function getBulkActions(?array $actionsIncludedInGroup = []): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getBulkActions(),
|
||||
[],
|
||||
);
|
||||
return [
|
||||
...parent::getBulkActions(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -285,10 +281,9 @@ class ActionLog extends BaseResource
|
||||
*/
|
||||
public static function getTableActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getTableActions(),
|
||||
[],
|
||||
);
|
||||
return [
|
||||
...parent::getTableActions(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -79,8 +79,6 @@ class Announcement extends BaseResource
|
||||
* Get the slug (URI key) for the resource.
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public static function getRecordSlug(): string
|
||||
{
|
||||
@@ -167,10 +165,9 @@ class Announcement extends BaseResource
|
||||
*/
|
||||
public static function getFilters(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getFilters(),
|
||||
[]
|
||||
);
|
||||
return [
|
||||
...parent::getFilters(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -180,10 +177,9 @@ class Announcement extends BaseResource
|
||||
*/
|
||||
public static function getActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getActions(),
|
||||
[],
|
||||
);
|
||||
return [
|
||||
...parent::getActions(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -194,10 +190,9 @@ class Announcement extends BaseResource
|
||||
*/
|
||||
public static function getBulkActions(?array $actionsIncludedInGroup = []): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getBulkActions(),
|
||||
[],
|
||||
);
|
||||
return [
|
||||
...parent::getBulkActions(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -207,10 +202,9 @@ class Announcement extends BaseResource
|
||||
*/
|
||||
public static function getTableActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getTableActions(),
|
||||
[],
|
||||
);
|
||||
return [
|
||||
...parent::getTableActions(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -23,9 +23,8 @@ class ManageAnnouncements extends BaseManageResources
|
||||
*/
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getHeaderActions(),
|
||||
[],
|
||||
);
|
||||
return [
|
||||
...parent::getHeaderActions(),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -84,8 +84,6 @@ class Dump extends BaseResource
|
||||
* Get the slug (URI key) for the resource.
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public static function getRecordSlug(): string
|
||||
{
|
||||
@@ -183,10 +181,9 @@ class Dump extends BaseResource
|
||||
*/
|
||||
public static function getFilters(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getFilters(),
|
||||
[]
|
||||
);
|
||||
return [
|
||||
...parent::getFilters(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -196,10 +193,9 @@ class Dump extends BaseResource
|
||||
*/
|
||||
public static function getActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getActions(),
|
||||
[],
|
||||
);
|
||||
return [
|
||||
...parent::getActions(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -210,10 +206,9 @@ class Dump extends BaseResource
|
||||
*/
|
||||
public static function getBulkActions(?array $actionsIncludedInGroup = []): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getBulkActions(),
|
||||
[],
|
||||
);
|
||||
return [
|
||||
...parent::getBulkActions(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -81,8 +81,6 @@ class Feature extends BaseResource
|
||||
* Get the slug (URI key) for the resource.
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public static function getRecordSlug(): string
|
||||
{
|
||||
@@ -209,10 +207,9 @@ class Feature extends BaseResource
|
||||
*/
|
||||
public static function getActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getActions(),
|
||||
[],
|
||||
);
|
||||
return [
|
||||
...parent::getActions(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -223,10 +220,9 @@ class Feature extends BaseResource
|
||||
*/
|
||||
public static function getBulkActions(?array $actionsIncludedInGroup = []): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getBulkActions(),
|
||||
[],
|
||||
);
|
||||
return [
|
||||
...parent::getBulkActions(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -236,10 +232,9 @@ class Feature extends BaseResource
|
||||
*/
|
||||
public static function getTableActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getTableActions(),
|
||||
[],
|
||||
);
|
||||
return [
|
||||
...parent::getTableActions(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -11,8 +11,6 @@ use App\Filament\Components\Fields\BelongsTo;
|
||||
use App\Filament\Components\Fields\Select;
|
||||
use App\Filament\Components\Infolist\BelongsToEntry;
|
||||
use App\Filament\Components\Infolist\TextEntry;
|
||||
use App\Filament\Resources\Admin\FeaturedTheme\Pages\CreateFeaturedTheme;
|
||||
use App\Filament\Resources\Admin\FeaturedTheme\Pages\EditFeaturedTheme;
|
||||
use App\Filament\Resources\Admin\FeaturedTheme\Pages\ListFeaturedThemes;
|
||||
use App\Filament\Resources\Admin\FeaturedTheme\Pages\ViewFeaturedTheme;
|
||||
use App\Filament\Resources\Auth\User as UserResource;
|
||||
@@ -96,8 +94,6 @@ class FeaturedTheme extends BaseResource
|
||||
* Get the slug (URI key) for the resource.
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public static function getRecordSlug(): string
|
||||
{
|
||||
@@ -289,12 +285,9 @@ class FeaturedTheme extends BaseResource
|
||||
public static function getRelations(): array
|
||||
{
|
||||
return [
|
||||
RelationGroup::make(static::getLabel(),
|
||||
array_merge(
|
||||
[],
|
||||
parent::getBaseRelations(),
|
||||
)
|
||||
),
|
||||
RelationGroup::make(static::getLabel(), [
|
||||
...parent::getBaseRelations(),
|
||||
]),
|
||||
];
|
||||
}
|
||||
|
||||
@@ -305,10 +298,9 @@ class FeaturedTheme extends BaseResource
|
||||
*/
|
||||
public static function getFilters(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getFilters(),
|
||||
[]
|
||||
);
|
||||
return [
|
||||
...parent::getFilters(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -318,10 +310,9 @@ class FeaturedTheme extends BaseResource
|
||||
*/
|
||||
public static function getActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getActions(),
|
||||
[],
|
||||
);
|
||||
return [
|
||||
...parent::getActions(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -332,10 +323,9 @@ class FeaturedTheme extends BaseResource
|
||||
*/
|
||||
public static function getBulkActions(?array $actionsIncludedInGroup = []): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getBulkActions(),
|
||||
[],
|
||||
);
|
||||
return [
|
||||
...parent::getBulkActions(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -345,10 +335,9 @@ class FeaturedTheme extends BaseResource
|
||||
*/
|
||||
public static function getTableActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getTableActions(),
|
||||
[],
|
||||
);
|
||||
return [
|
||||
...parent::getTableActions(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -362,9 +351,7 @@ class FeaturedTheme extends BaseResource
|
||||
{
|
||||
return [
|
||||
'index' => ListFeaturedThemes::route('/'),
|
||||
'create' => CreateFeaturedTheme::route('/create'),
|
||||
'view' => ViewFeaturedTheme::route('/{record:featured_theme_id}'),
|
||||
'edit' => EditFeaturedTheme::route('/{record:featured_theme_id}/edit'),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Filament\Resources\Admin\FeaturedTheme\Pages;
|
||||
|
||||
use App\Filament\Resources\Base\BaseCreateResource;
|
||||
use App\Filament\Resources\Admin\FeaturedTheme;
|
||||
|
||||
/**
|
||||
* Class CreateFeaturedTheme.
|
||||
*/
|
||||
class CreateFeaturedTheme extends BaseCreateResource
|
||||
{
|
||||
protected static string $resource = FeaturedTheme::class;
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Filament\Resources\Admin\FeaturedTheme\Pages;
|
||||
|
||||
use App\Filament\Resources\Admin\FeaturedTheme;
|
||||
use App\Filament\Resources\Base\BaseEditResource;
|
||||
|
||||
/**
|
||||
* Class EditFeaturedTheme.
|
||||
*/
|
||||
class EditFeaturedTheme extends BaseEditResource
|
||||
{
|
||||
protected static string $resource = FeaturedTheme::class;
|
||||
|
||||
/**
|
||||
* Get the header actions available.
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getHeaderActions(),
|
||||
[],
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -23,9 +23,8 @@ class ListFeaturedThemes extends BaseListResources
|
||||
*/
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getHeaderActions(),
|
||||
[],
|
||||
);
|
||||
return [
|
||||
...parent::getHeaderActions(),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,9 +23,8 @@ class ViewFeaturedTheme extends BaseViewResource
|
||||
*/
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getHeaderActions(),
|
||||
[],
|
||||
);
|
||||
return [
|
||||
...parent::getHeaderActions(),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -86,8 +86,6 @@ class Report extends BaseResource
|
||||
* Get the slug (URI key) for the resource.
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public static function getRecordSlug(): string
|
||||
{
|
||||
@@ -226,10 +224,9 @@ class Report extends BaseResource
|
||||
*/
|
||||
public static function getActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getActions(),
|
||||
[],
|
||||
);
|
||||
return [
|
||||
...parent::getActions(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -240,10 +237,9 @@ class Report extends BaseResource
|
||||
*/
|
||||
public static function getBulkActions(?array $actionsIncludedInGroup = []): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getBulkActions(),
|
||||
[],
|
||||
);
|
||||
return [
|
||||
...parent::getBulkActions(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -253,10 +249,9 @@ class Report extends BaseResource
|
||||
*/
|
||||
public static function getTableActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getTableActions(),
|
||||
[],
|
||||
);
|
||||
return [
|
||||
...parent::getTableActions(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -269,13 +264,9 @@ class Report extends BaseResource
|
||||
public static function getRelations(): array
|
||||
{
|
||||
return [
|
||||
RelationGroup::make(static::getLabel(),
|
||||
array_merge(
|
||||
[
|
||||
StepReportRelationManager::class,
|
||||
],
|
||||
)
|
||||
),
|
||||
RelationGroup::make(static::getLabel(), [
|
||||
StepReportRelationManager::class,
|
||||
]),
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
@@ -23,9 +23,8 @@ class ListReports extends BaseListResources
|
||||
*/
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getHeaderActions(),
|
||||
[],
|
||||
);
|
||||
return [
|
||||
...parent::getHeaderActions(),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,9 +23,8 @@ class ViewReport extends BaseViewResource
|
||||
*/
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getHeaderActions(),
|
||||
[],
|
||||
);
|
||||
return [
|
||||
...parent::getHeaderActions(),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
+14
-17
@@ -44,10 +44,9 @@ class StepReportRelationManager extends ReportStepRelationManager
|
||||
*/
|
||||
public static function getFilters(): array
|
||||
{
|
||||
return array_merge(
|
||||
[],
|
||||
parent::getFilters(),
|
||||
);
|
||||
return [
|
||||
...parent::getFilters(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -57,10 +56,9 @@ class StepReportRelationManager extends ReportStepRelationManager
|
||||
*/
|
||||
public static function getActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getActions(),
|
||||
[],
|
||||
);
|
||||
return [
|
||||
...parent::getActions(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -71,22 +69,21 @@ class StepReportRelationManager extends ReportStepRelationManager
|
||||
*/
|
||||
public static function getBulkActions(?array $actionsIncludedInGroup = []): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getBulkActions(),
|
||||
[],
|
||||
);
|
||||
return [
|
||||
...parent::getBulkActions(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the header actions available for the relation. These are merged with the table actions of the resources.
|
||||
* Get the header actions available for the relation.
|
||||
* These are merged with the table actions of the resources.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getHeaderActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getHeaderActions(),
|
||||
[],
|
||||
);
|
||||
return [
|
||||
...parent::getHeaderActions(),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -89,8 +89,6 @@ class ReportStep extends BaseResource
|
||||
* Get the slug (URI key) for the resource.
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public static function getRecordSlug(): string
|
||||
{
|
||||
@@ -277,10 +275,9 @@ class ReportStep extends BaseResource
|
||||
*/
|
||||
public static function getActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getActions(),
|
||||
[],
|
||||
);
|
||||
return [
|
||||
...parent::getActions(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -291,10 +288,9 @@ class ReportStep extends BaseResource
|
||||
*/
|
||||
public static function getBulkActions(?array $actionsIncludedInGroup = []): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getBulkActions(),
|
||||
[],
|
||||
);
|
||||
return [
|
||||
...parent::getBulkActions(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -304,10 +300,9 @@ class ReportStep extends BaseResource
|
||||
*/
|
||||
public static function getTableActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getTableActions(),
|
||||
[],
|
||||
);
|
||||
return [
|
||||
...parent::getTableActions(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -23,9 +23,8 @@ class ListReportSteps extends BaseListResources
|
||||
*/
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getHeaderActions(),
|
||||
[],
|
||||
);
|
||||
return [
|
||||
...parent::getHeaderActions(),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,9 +23,8 @@ class ViewReportStep extends BaseViewResource
|
||||
*/
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getHeaderActions(),
|
||||
[],
|
||||
);
|
||||
return [
|
||||
...parent::getHeaderActions(),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,8 +8,6 @@ use App\Filament\Actions\Models\Auth\Permission\GiveRoleAction;
|
||||
use App\Filament\Actions\Models\Auth\Permission\RevokeRoleAction;
|
||||
use App\Filament\Components\Columns\TextColumn;
|
||||
use App\Filament\Components\Infolist\TextEntry;
|
||||
use App\Filament\Resources\Auth\Permission\Pages\CreatePermission;
|
||||
use App\Filament\Resources\Auth\Permission\Pages\EditPermission;
|
||||
use App\Filament\Resources\Auth\Permission\Pages\ListPermissions;
|
||||
use App\Filament\Resources\Auth\Permission\Pages\ViewPermission;
|
||||
use App\Filament\Resources\Auth\Permission\RelationManagers\RolePermissionRelationManager;
|
||||
@@ -88,8 +86,6 @@ class Permission extends BaseResource
|
||||
* Get the slug (URI key) for the resource.
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public static function getRecordSlug(): string
|
||||
{
|
||||
@@ -190,14 +186,10 @@ class Permission extends BaseResource
|
||||
public static function getRelations(): array
|
||||
{
|
||||
return [
|
||||
RelationGroup::make(static::getLabel(),
|
||||
array_merge(
|
||||
[
|
||||
RolePermissionRelationManager::class,
|
||||
UserPermissionRelationManager::class,
|
||||
],
|
||||
)
|
||||
),
|
||||
RelationGroup::make(static::getLabel(), [
|
||||
RolePermissionRelationManager::class,
|
||||
UserPermissionRelationManager::class,
|
||||
]),
|
||||
];
|
||||
}
|
||||
|
||||
@@ -220,16 +212,15 @@ class Permission extends BaseResource
|
||||
*/
|
||||
public static function getActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getActions(),
|
||||
[
|
||||
ActionGroup::make([
|
||||
GiveRoleAction::make('give-role'),
|
||||
return [
|
||||
...parent::getActions(),
|
||||
|
||||
RevokeRoleAction::make('revoke-role'),
|
||||
]),
|
||||
],
|
||||
);
|
||||
ActionGroup::make([
|
||||
GiveRoleAction::make('give-role'),
|
||||
|
||||
RevokeRoleAction::make('revoke-role'),
|
||||
]),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -240,10 +231,9 @@ class Permission extends BaseResource
|
||||
*/
|
||||
public static function getBulkActions(?array $actionsIncludedInGroup = []): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getBulkActions(),
|
||||
[],
|
||||
);
|
||||
return [
|
||||
...parent::getBulkActions(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -253,10 +243,9 @@ class Permission extends BaseResource
|
||||
*/
|
||||
public static function getTableActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getTableActions(),
|
||||
[],
|
||||
);
|
||||
return [
|
||||
...parent::getTableActions(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -270,9 +259,7 @@ class Permission extends BaseResource
|
||||
{
|
||||
return [
|
||||
'index' => ListPermissions::route('/'),
|
||||
'create' => CreatePermission::route('/create'),
|
||||
'view' => ViewPermission::route('/{record:id}'),
|
||||
'edit' => EditPermission::route('/{record:id}/edit'),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Filament\Resources\Auth\Permission\Pages;
|
||||
|
||||
use App\Filament\Resources\Base\BaseCreateResource;
|
||||
use App\Filament\Resources\Auth\Permission;
|
||||
|
||||
/**
|
||||
* Class CreatePermission.
|
||||
*/
|
||||
class CreatePermission extends BaseCreateResource
|
||||
{
|
||||
protected static string $resource = Permission::class;
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Filament\Resources\Auth\Permission\Pages;
|
||||
|
||||
use App\Filament\Resources\Auth\Permission;
|
||||
use App\Filament\Resources\Base\BaseEditResource;
|
||||
|
||||
/**
|
||||
* Class EditPermission.
|
||||
*/
|
||||
class EditPermission extends BaseEditResource
|
||||
{
|
||||
protected static string $resource = Permission::class;
|
||||
|
||||
/**
|
||||
* Get the header actions available.
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getHeaderActions(),
|
||||
[],
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -23,9 +23,8 @@ class ListPermissions extends BaseListResources
|
||||
*/
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getHeaderActions(),
|
||||
[],
|
||||
);
|
||||
return [
|
||||
...parent::getHeaderActions(),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,9 +23,8 @@ class ViewPermission extends BaseViewResource
|
||||
*/
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getHeaderActions(),
|
||||
[],
|
||||
);
|
||||
return [
|
||||
...parent::getHeaderActions(),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
+14
-17
@@ -44,10 +44,9 @@ class RolePermissionRelationManager extends RoleRelationManager
|
||||
*/
|
||||
public static function getFilters(): array
|
||||
{
|
||||
return array_merge(
|
||||
[],
|
||||
parent::getFilters(),
|
||||
);
|
||||
return [
|
||||
...parent::getFilters(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -57,10 +56,9 @@ class RolePermissionRelationManager extends RoleRelationManager
|
||||
*/
|
||||
public static function getActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getActions(),
|
||||
[],
|
||||
);
|
||||
return [
|
||||
...parent::getActions(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -71,22 +69,21 @@ class RolePermissionRelationManager extends RoleRelationManager
|
||||
*/
|
||||
public static function getBulkActions(?array $actionsIncludedInGroup = []): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getBulkActions(),
|
||||
[],
|
||||
);
|
||||
return [
|
||||
...parent::getBulkActions(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the header actions available for the relation. These are merged with the table actions of the resources.
|
||||
* Get the header actions available for the relation.
|
||||
* These are merged with the table actions of the resources.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getHeaderActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getHeaderActions(),
|
||||
[],
|
||||
);
|
||||
return [
|
||||
...parent::getHeaderActions(),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
+14
-17
@@ -44,10 +44,9 @@ class UserPermissionRelationManager extends UserRelationManager
|
||||
*/
|
||||
public static function getFilters(): array
|
||||
{
|
||||
return array_merge(
|
||||
[],
|
||||
parent::getFilters(),
|
||||
);
|
||||
return [
|
||||
...parent::getFilters(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -57,10 +56,9 @@ class UserPermissionRelationManager extends UserRelationManager
|
||||
*/
|
||||
public static function getActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getActions(),
|
||||
[],
|
||||
);
|
||||
return [
|
||||
...parent::getActions(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -72,22 +70,21 @@ class UserPermissionRelationManager extends UserRelationManager
|
||||
*/
|
||||
public static function getBulkActions(?array $actionsIncludedInGroup = []): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getBulkActions(),
|
||||
[],
|
||||
);
|
||||
return [
|
||||
...parent::getBulkActions(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the header actions available for the relation. These are merged with the table actions of the resources.
|
||||
* Get the header actions available for the relation.
|
||||
* These are merged with the table actions of the resources.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getHeaderActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getHeaderActions(),
|
||||
[],
|
||||
);
|
||||
return [
|
||||
...parent::getHeaderActions(),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,8 +11,6 @@ use App\Filament\Components\Filters\CheckboxFilter;
|
||||
use App\Filament\Components\Filters\NumberFilter;
|
||||
use App\Filament\Components\Infolist\TextEntry;
|
||||
use App\Filament\Resources\BaseResource;
|
||||
use App\Filament\Resources\Auth\Role\Pages\CreateRole;
|
||||
use App\Filament\Resources\Auth\Role\Pages\EditRole;
|
||||
use App\Filament\Resources\Auth\Role\Pages\ListRoles;
|
||||
use App\Filament\Resources\Auth\Role\Pages\ViewRole;
|
||||
use App\Filament\Resources\Auth\Role\RelationManagers\PermissionRoleRelationManager;
|
||||
@@ -96,8 +94,6 @@ class Role extends BaseResource
|
||||
* Get the slug (URI key) for the resource.
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public static function getRecordSlug(): string
|
||||
{
|
||||
@@ -233,14 +229,10 @@ class Role extends BaseResource
|
||||
public static function getRelations(): array
|
||||
{
|
||||
return [
|
||||
RelationGroup::make(static::getLabel(),
|
||||
array_merge(
|
||||
[
|
||||
PermissionRoleRelationManager::class,
|
||||
UserRoleRelationManager::class,
|
||||
],
|
||||
)
|
||||
),
|
||||
RelationGroup::make(static::getLabel(), [
|
||||
PermissionRoleRelationManager::class,
|
||||
UserRoleRelationManager::class,
|
||||
]),
|
||||
];
|
||||
}
|
||||
|
||||
@@ -269,16 +261,15 @@ class Role extends BaseResource
|
||||
*/
|
||||
public static function getActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getActions(),
|
||||
[
|
||||
ActionGroup::make([
|
||||
GivePermissionAction::make('give-permission'),
|
||||
return [
|
||||
...parent::getActions(),
|
||||
|
||||
RevokePermissionAction::make('revoke-permission'),
|
||||
]),
|
||||
],
|
||||
);
|
||||
ActionGroup::make([
|
||||
GivePermissionAction::make('give-permission'),
|
||||
|
||||
RevokePermissionAction::make('revoke-permission'),
|
||||
]),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -289,10 +280,9 @@ class Role extends BaseResource
|
||||
*/
|
||||
public static function getBulkActions(?array $actionsIncludedInGroup = []): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getBulkActions(),
|
||||
[],
|
||||
);
|
||||
return [
|
||||
...parent::getBulkActions(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -302,10 +292,9 @@ class Role extends BaseResource
|
||||
*/
|
||||
public static function getTableActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getTableActions(),
|
||||
[],
|
||||
);
|
||||
return [
|
||||
...parent::getTableActions(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -319,9 +308,7 @@ class Role extends BaseResource
|
||||
{
|
||||
return [
|
||||
'index' => ListRoles::route('/'),
|
||||
'create' => CreateRole::route('/create'),
|
||||
'view' => ViewRole::route('/{record:id}'),
|
||||
'edit' => EditRole::route('/{record:id}/edit'),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Filament\Resources\Auth\Role\Pages;
|
||||
|
||||
use App\Filament\Resources\Base\BaseCreateResource;
|
||||
use App\Filament\Resources\Auth\Role;
|
||||
|
||||
/**
|
||||
* Class CreateRole.
|
||||
*/
|
||||
class CreateRole extends BaseCreateResource
|
||||
{
|
||||
protected static string $resource = Role::class;
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Filament\Resources\Auth\Role\Pages;
|
||||
|
||||
use App\Filament\HeaderActions\Models\Auth\Role\GivePermissionHeaderAction;
|
||||
use App\Filament\HeaderActions\Models\Auth\Role\RevokePermissionHeaderAction;
|
||||
use App\Filament\Resources\Auth\Role;
|
||||
use App\Filament\Resources\Base\BaseEditResource;
|
||||
use Filament\Actions\ActionGroup;
|
||||
|
||||
/**
|
||||
* Class EditRole.
|
||||
*/
|
||||
class EditRole extends BaseEditResource
|
||||
{
|
||||
protected static string $resource = Role::class;
|
||||
|
||||
/**
|
||||
* Get the header actions available.
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getHeaderActions(),
|
||||
[
|
||||
ActionGroup::make([
|
||||
GivePermissionHeaderAction::make('give-permission'),
|
||||
|
||||
RevokePermissionHeaderAction::make('revoke-permission'),
|
||||
]),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -23,9 +23,8 @@ class ListRoles extends BaseListResources
|
||||
*/
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getHeaderActions(),
|
||||
[],
|
||||
);
|
||||
return [
|
||||
...parent::getHeaderActions(),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,8 +4,11 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Filament\Resources\Auth\Role\Pages;
|
||||
|
||||
use App\Filament\HeaderActions\Models\Auth\Role\GivePermissionHeaderAction;
|
||||
use App\Filament\HeaderActions\Models\Auth\Role\RevokePermissionHeaderAction;
|
||||
use App\Filament\Resources\Base\BaseViewResource;
|
||||
use App\Filament\Resources\Auth\Role;
|
||||
use Filament\Actions\ActionGroup;
|
||||
|
||||
/**
|
||||
* Class ViewRole.
|
||||
@@ -23,9 +26,14 @@ class ViewRole extends BaseViewResource
|
||||
*/
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getHeaderActions(),
|
||||
[],
|
||||
);
|
||||
return [
|
||||
...parent::getHeaderActions(),
|
||||
|
||||
ActionGroup::make([
|
||||
GivePermissionHeaderAction::make('give-permission'),
|
||||
|
||||
RevokePermissionHeaderAction::make('revoke-permission'),
|
||||
]),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
+14
-17
@@ -44,10 +44,9 @@ class PermissionRoleRelationManager extends PermissionRelationManager
|
||||
*/
|
||||
public static function getFilters(): array
|
||||
{
|
||||
return array_merge(
|
||||
[],
|
||||
parent::getFilters(),
|
||||
);
|
||||
return [
|
||||
...parent::getFilters(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -57,10 +56,9 @@ class PermissionRoleRelationManager extends PermissionRelationManager
|
||||
*/
|
||||
public static function getActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getActions(),
|
||||
[],
|
||||
);
|
||||
return [
|
||||
...parent::getActions(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -71,22 +69,21 @@ class PermissionRoleRelationManager extends PermissionRelationManager
|
||||
*/
|
||||
public static function getBulkActions(?array $actionsIncludedInGroup = []): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getBulkActions(),
|
||||
[],
|
||||
);
|
||||
return [
|
||||
...parent::getBulkActions(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the header actions available for the relation. These are merged with the table actions of the resources.
|
||||
* Get the header actions available for the relation.
|
||||
* These are merged with the table actions of the resources.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getHeaderActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getHeaderActions(),
|
||||
[],
|
||||
);
|
||||
return [
|
||||
...parent::getHeaderActions(),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -73,22 +73,21 @@ class UserRoleRelationManager extends UserRelationManager
|
||||
*/
|
||||
public static function getBulkActions(?array $actionsIncludedInGroup = []): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getBulkActions(),
|
||||
[],
|
||||
);
|
||||
return [
|
||||
...parent::getBulkActions(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the header actions available for the relation. These are merged with the table actions of the resources.
|
||||
* Get the header actions available for the relation.
|
||||
* These are merged with the table actions of the resources.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getHeaderActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getHeaderActions(),
|
||||
[],
|
||||
);
|
||||
return [
|
||||
...parent::getHeaderActions(),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,8 +11,6 @@ use App\Filament\Actions\Models\Auth\User\RevokeRoleAction;
|
||||
use App\Filament\Components\Columns\TextColumn;
|
||||
use App\Filament\Components\Infolist\TextEntry;
|
||||
use App\Filament\Resources\BaseResource;
|
||||
use App\Filament\Resources\Auth\User\Pages\CreateUser;
|
||||
use App\Filament\Resources\Auth\User\Pages\EditUser;
|
||||
use App\Filament\Resources\Auth\User\Pages\ListUsers;
|
||||
use App\Filament\Resources\Auth\User\Pages\ViewUser;
|
||||
use App\Filament\Resources\Auth\User\RelationManagers\PermissionUserRelationManager;
|
||||
@@ -93,8 +91,6 @@ class User extends BaseResource
|
||||
* Get the slug (URI key) for the resource.
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public static function getRecordSlug(): string
|
||||
{
|
||||
@@ -219,16 +215,13 @@ class User extends BaseResource
|
||||
public static function getRelations(): array
|
||||
{
|
||||
return [
|
||||
RelationGroup::make(static::getLabel(),
|
||||
array_merge(
|
||||
[
|
||||
RoleUserRelationManager::class,
|
||||
PermissionUserRelationManager::class,
|
||||
PlaylistUserRelationManager::class,
|
||||
],
|
||||
parent::getBaseRelations(),
|
||||
)
|
||||
),
|
||||
RelationGroup::make(static::getLabel(), [
|
||||
RoleUserRelationManager::class,
|
||||
PermissionUserRelationManager::class,
|
||||
PlaylistUserRelationManager::class,
|
||||
|
||||
...parent::getBaseRelations(),
|
||||
]),
|
||||
];
|
||||
}
|
||||
|
||||
@@ -251,20 +244,19 @@ class User extends BaseResource
|
||||
*/
|
||||
public static function getActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getActions(),
|
||||
[
|
||||
ActionGroup::make([
|
||||
GiveRoleAction::make('give-role'),
|
||||
return [
|
||||
...parent::getActions(),
|
||||
|
||||
RevokeRoleAction::make('revoke-role'),
|
||||
ActionGroup::make([
|
||||
GiveRoleAction::make('give-role'),
|
||||
|
||||
GivePermissionAction::make('give-permission'),
|
||||
RevokeRoleAction::make('revoke-role'),
|
||||
|
||||
RevokePermissionAction::make('revoke-permission'),
|
||||
]),
|
||||
],
|
||||
);
|
||||
GivePermissionAction::make('give-permission'),
|
||||
|
||||
RevokePermissionAction::make('revoke-permission'),
|
||||
]),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -275,10 +267,9 @@ class User extends BaseResource
|
||||
*/
|
||||
public static function getBulkActions(?array $actionsIncludedInGroup = []): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getBulkActions(),
|
||||
[],
|
||||
);
|
||||
return [
|
||||
...parent::getBulkActions(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -288,10 +279,9 @@ class User extends BaseResource
|
||||
*/
|
||||
public static function getTableActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getTableActions(),
|
||||
[],
|
||||
);
|
||||
return [
|
||||
...parent::getTableActions(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -305,9 +295,7 @@ class User extends BaseResource
|
||||
{
|
||||
return [
|
||||
'index' => ListUsers::route('/'),
|
||||
'create' => CreateUser::route('/create'),
|
||||
'view' => ViewUser::route('/{record:id}'),
|
||||
'edit' => EditUser::route('/{record:id}/edit'),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Filament\Resources\Auth\User\Pages;
|
||||
|
||||
use App\Filament\Resources\Base\BaseCreateResource;
|
||||
use App\Filament\Resources\Auth\User;
|
||||
|
||||
/**
|
||||
* Class CreateUser.
|
||||
*/
|
||||
class CreateUser extends BaseCreateResource
|
||||
{
|
||||
protected static string $resource = User::class;
|
||||
}
|
||||
@@ -1,46 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Filament\Resources\Auth\User\Pages;
|
||||
|
||||
use App\Filament\HeaderActions\Models\Auth\User\GivePermissionHeaderAction;
|
||||
use App\Filament\HeaderActions\Models\Auth\User\GiveRoleHeaderAction;
|
||||
use App\Filament\HeaderActions\Models\Auth\User\RevokePermissionHeaderAction;
|
||||
use App\Filament\HeaderActions\Models\Auth\User\RevokeRoleHeaderAction;
|
||||
use App\Filament\Resources\Auth\User;
|
||||
use App\Filament\Resources\Base\BaseEditResource;
|
||||
use Filament\Actions\ActionGroup;
|
||||
|
||||
/**
|
||||
* Class EditUser.
|
||||
*/
|
||||
class EditUser extends BaseEditResource
|
||||
{
|
||||
protected static string $resource = User::class;
|
||||
|
||||
/**
|
||||
* Get the header actions available.
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getHeaderActions(),
|
||||
[
|
||||
ActionGroup::make([
|
||||
GiveRoleHeaderAction::make('give-role'),
|
||||
|
||||
RevokeRoleHeaderAction::make('revoke-role'),
|
||||
|
||||
GivePermissionHeaderAction::make('give-permission'),
|
||||
|
||||
RevokePermissionHeaderAction::make('revoke-permission'),
|
||||
]),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -23,9 +23,8 @@ class ListUsers extends BaseListResources
|
||||
*/
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getHeaderActions(),
|
||||
[],
|
||||
);
|
||||
return [
|
||||
...parent::getHeaderActions(),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,8 +4,13 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Filament\Resources\Auth\User\Pages;
|
||||
|
||||
use App\Filament\HeaderActions\Models\Auth\User\GivePermissionHeaderAction;
|
||||
use App\Filament\HeaderActions\Models\Auth\User\GiveRoleHeaderAction;
|
||||
use App\Filament\HeaderActions\Models\Auth\User\RevokePermissionHeaderAction;
|
||||
use App\Filament\HeaderActions\Models\Auth\User\RevokeRoleHeaderAction;
|
||||
use App\Filament\Resources\Base\BaseViewResource;
|
||||
use App\Filament\Resources\Auth\User;
|
||||
use Filament\Actions\ActionGroup;
|
||||
|
||||
/**
|
||||
* Class ViewUser.
|
||||
@@ -23,9 +28,18 @@ class ViewUser extends BaseViewResource
|
||||
*/
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getHeaderActions(),
|
||||
[],
|
||||
);
|
||||
return [
|
||||
...parent::getHeaderActions(),
|
||||
|
||||
ActionGroup::make([
|
||||
GiveRoleHeaderAction::make('give-role'),
|
||||
|
||||
RevokeRoleHeaderAction::make('revoke-role'),
|
||||
|
||||
GivePermissionHeaderAction::make('give-permission'),
|
||||
|
||||
RevokePermissionHeaderAction::make('revoke-permission'),
|
||||
]),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
+14
-17
@@ -44,10 +44,9 @@ class PermissionUserRelationManager extends PermissionRelationManager
|
||||
*/
|
||||
public static function getFilters(): array
|
||||
{
|
||||
return array_merge(
|
||||
[],
|
||||
parent::getFilters(),
|
||||
);
|
||||
return [
|
||||
...parent::getFilters(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -57,10 +56,9 @@ class PermissionUserRelationManager extends PermissionRelationManager
|
||||
*/
|
||||
public static function getActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getActions(),
|
||||
[],
|
||||
);
|
||||
return [
|
||||
...parent::getActions(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -71,22 +69,21 @@ class PermissionUserRelationManager extends PermissionRelationManager
|
||||
*/
|
||||
public static function getBulkActions(?array $actionsIncludedInGroup = []): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getBulkActions(),
|
||||
[],
|
||||
);
|
||||
return [
|
||||
...parent::getBulkActions(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the header actions available for the relation. These are merged with the table actions of the resources.
|
||||
* Get the header actions available for the relation.
|
||||
* These are merged with the table actions of the resources.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getHeaderActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getHeaderActions(),
|
||||
[],
|
||||
);
|
||||
return [
|
||||
...parent::getHeaderActions(),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,10 +54,9 @@ class PlaylistUserRelationManager extends PlaylistRelationManager
|
||||
*/
|
||||
public static function getActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getActions(),
|
||||
[],
|
||||
);
|
||||
return [
|
||||
...parent::getActions(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -69,22 +68,21 @@ class PlaylistUserRelationManager extends PlaylistRelationManager
|
||||
*/
|
||||
public static function getBulkActions(?array $actionsIncludedInGroup = []): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getBulkActions(),
|
||||
[],
|
||||
);
|
||||
return [
|
||||
...parent::getBulkActions(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the header actions available for the relation. These are merged with the table actions of the resources.
|
||||
* Get the header actions available for the relation.
|
||||
* These are merged with the table actions of the resources.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getHeaderActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getHeaderActions(),
|
||||
[],
|
||||
);
|
||||
return [
|
||||
...parent::getHeaderActions(),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,10 +45,9 @@ class RoleUserRelationManager extends RoleRelationManager
|
||||
*/
|
||||
public static function getFilters(): array
|
||||
{
|
||||
return array_merge(
|
||||
[],
|
||||
parent::getFilters(),
|
||||
);
|
||||
return [
|
||||
...parent::getFilters(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -58,12 +57,11 @@ class RoleUserRelationManager extends RoleRelationManager
|
||||
*/
|
||||
public static function getActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getActions(),
|
||||
[
|
||||
EditAction::make(),
|
||||
],
|
||||
);
|
||||
return [
|
||||
...parent::getActions(),
|
||||
|
||||
EditAction::make(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -74,22 +72,21 @@ class RoleUserRelationManager extends RoleRelationManager
|
||||
*/
|
||||
public static function getBulkActions(?array $actionsIncludedInGroup = []): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getBulkActions(),
|
||||
[],
|
||||
);
|
||||
return [
|
||||
...parent::getBulkActions(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the header actions available for the relation. These are merged with the table actions of the resources.
|
||||
* Get the header actions available for the relation.
|
||||
* These are merged with the table actions of the resources.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getHeaderActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getHeaderActions(),
|
||||
[],
|
||||
);
|
||||
return [
|
||||
...parent::getHeaderActions(),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Filament\Resources\Base;
|
||||
|
||||
use App\Models\Admin\ActionLog;
|
||||
use Filament\Resources\Pages\CreateRecord;
|
||||
|
||||
/**
|
||||
* Class BaseCreateResource.
|
||||
*/
|
||||
abstract class BaseCreateResource extends CreateRecord
|
||||
{
|
||||
/**
|
||||
* Run after the record is created.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function afterCreate(): void
|
||||
{
|
||||
ActionLog::modelCreated($this->getRecord());
|
||||
}
|
||||
}
|
||||
@@ -1,54 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Filament\Resources\Base;
|
||||
|
||||
use App\Filament\HeaderActions\Base\DeleteHeaderAction;
|
||||
use App\Filament\HeaderActions\Base\ForceDeleteHeaderAction;
|
||||
use App\Filament\HeaderActions\Base\RestoreHeaderAction;
|
||||
use App\Filament\HeaderActions\Base\ViewHeaderAction;
|
||||
use App\Models\Admin\ActionLog;
|
||||
use Filament\Actions\ActionGroup;
|
||||
use Filament\Resources\Pages\EditRecord;
|
||||
|
||||
/**
|
||||
* Class BaseEditResource.
|
||||
*/
|
||||
abstract class BaseEditResource extends EditRecord
|
||||
{
|
||||
/**
|
||||
* Get the header actions available.
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
ViewHeaderAction::make(),
|
||||
|
||||
ActionGroup::make([
|
||||
DeleteHeaderAction::make()
|
||||
->label(__('filament.actions.base.delete')),
|
||||
|
||||
ForceDeleteHeaderAction::make(),
|
||||
])
|
||||
->icon(__('filament-icons.actions.base.group_delete'))
|
||||
->color('danger'),
|
||||
|
||||
RestoreHeaderAction::make(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Run after the record is edited.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function afterSave(): void
|
||||
{
|
||||
ActionLog::modelUpdated($this->getRecord());
|
||||
}
|
||||
}
|
||||
@@ -4,10 +4,13 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Filament\Resources\Base;
|
||||
|
||||
use App\Filament\HeaderActions\Base\DeleteHeaderAction;
|
||||
use App\Filament\HeaderActions\Base\EditHeaderAction;
|
||||
use App\Filament\HeaderActions\Base\ForceDeleteHeaderAction;
|
||||
use App\Filament\HeaderActions\Base\RestoreHeaderAction;
|
||||
use Awcodes\Recently\Concerns\HasRecentHistoryRecorder;
|
||||
use Filament\Actions\ActionGroup;
|
||||
use Filament\Resources\Pages\ViewRecord;
|
||||
use Illuminate\Support\Arr;
|
||||
|
||||
/**
|
||||
* Class BaseViewResource.
|
||||
@@ -25,21 +28,19 @@ class BaseViewResource extends ViewRecord
|
||||
*/
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
$pages = static::$resource::getPages();
|
||||
return [
|
||||
EditHeaderAction::make(),
|
||||
|
||||
if (Arr::has($pages, 'edit')) {
|
||||
$editPage = $pages['edit']->getPage();
|
||||
$action = (new $editPage)->getHeaderActions();
|
||||
} else {
|
||||
$action = [];
|
||||
}
|
||||
ActionGroup::make([
|
||||
DeleteHeaderAction::make()
|
||||
->label(__('filament.actions.base.delete')),
|
||||
|
||||
return array_merge(
|
||||
[
|
||||
EditHeaderAction::make()
|
||||
->visible(Arr::has($pages, 'edit')),
|
||||
],
|
||||
$action,
|
||||
);
|
||||
ForceDeleteHeaderAction::make(),
|
||||
])
|
||||
->icon(__('filament-icons.actions.base.group_delete'))
|
||||
->color('danger'),
|
||||
|
||||
RestoreHeaderAction::make(),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -177,18 +177,13 @@ abstract class BaseResource extends Resource
|
||||
public static function getBulkActions(?array $actionsIncludedInGroup = []): array
|
||||
{
|
||||
return [
|
||||
BulkActionGroup::make(
|
||||
array_merge(
|
||||
[
|
||||
DeleteBulkAction::make(),
|
||||
BulkActionGroup::make([
|
||||
DeleteBulkAction::make(),
|
||||
ForceDeleteBulkAction::make(),
|
||||
RestoreBulkAction::make(),
|
||||
|
||||
ForceDeleteBulkAction::make(),
|
||||
|
||||
RestoreBulkAction::make(),
|
||||
],
|
||||
$actionsIncludedInGroup,
|
||||
)
|
||||
),
|
||||
...$actionsIncludedInGroup,
|
||||
]),
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
@@ -12,8 +12,6 @@ use App\Filament\Components\Filters\DateFilter;
|
||||
use App\Filament\Components\Infolist\BelongsToEntry;
|
||||
use App\Filament\Components\Infolist\TextEntry;
|
||||
use App\Filament\Resources\BaseResource;
|
||||
use App\Filament\Resources\Discord\DiscordThread\Pages\CreateDiscordThread;
|
||||
use App\Filament\Resources\Discord\DiscordThread\Pages\EditDiscordThread;
|
||||
use App\Filament\Resources\Discord\DiscordThread\Pages\ListDiscordThreads;
|
||||
use App\Filament\Resources\Discord\DiscordThread\Pages\ViewDiscordThread;
|
||||
use App\Filament\Resources\Wiki\Anime as AnimeResource;
|
||||
@@ -108,8 +106,6 @@ class DiscordThread extends BaseResource
|
||||
* Get the slug (URI key) for the resource.
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public static function getRecordSlug(): string
|
||||
{
|
||||
@@ -222,12 +218,9 @@ class DiscordThread extends BaseResource
|
||||
public static function getRelations(): array
|
||||
{
|
||||
return [
|
||||
RelationGroup::make(static::getLabel(),
|
||||
array_merge(
|
||||
[],
|
||||
parent::getBaseRelations(),
|
||||
)
|
||||
),
|
||||
RelationGroup::make(static::getLabel(), [
|
||||
...parent::getBaseRelations(),
|
||||
]),
|
||||
];
|
||||
}
|
||||
|
||||
@@ -251,10 +244,9 @@ class DiscordThread extends BaseResource
|
||||
*/
|
||||
public static function getActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getActions(),
|
||||
[],
|
||||
);
|
||||
return [
|
||||
...parent::getActions(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -265,10 +257,9 @@ class DiscordThread extends BaseResource
|
||||
*/
|
||||
public static function getBulkActions(?array $actionsIncludedInGroup = []): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getBulkActions(),
|
||||
[],
|
||||
);
|
||||
return [
|
||||
...parent::getBulkActions(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -278,16 +269,15 @@ class DiscordThread extends BaseResource
|
||||
*/
|
||||
public static function getTableActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getTableActions(),
|
||||
[
|
||||
ActionGroup::make([
|
||||
DiscordEditMessageTableAction::make('edit-message'),
|
||||
return [
|
||||
...parent::getTableActions(),
|
||||
|
||||
DiscordSendMessageTableAction::make('send-message'),
|
||||
]),
|
||||
],
|
||||
);
|
||||
ActionGroup::make([
|
||||
DiscordEditMessageTableAction::make('edit-message'),
|
||||
|
||||
DiscordSendMessageTableAction::make('send-message'),
|
||||
]),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -301,9 +291,7 @@ class DiscordThread extends BaseResource
|
||||
{
|
||||
return [
|
||||
'index' => ListDiscordThreads::route('/'),
|
||||
'create' => CreateDiscordThread::route('/create'),
|
||||
'view' => ViewDiscordThread::route('/{record:thread_id}'),
|
||||
'edit' => EditDiscordThread::route('/{record:thread_id}/edit'),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Filament\Resources\Discord\DiscordThread\Pages;
|
||||
|
||||
use App\Filament\Resources\Base\BaseCreateResource;
|
||||
use App\Filament\Resources\Discord\DiscordThread;
|
||||
|
||||
/**
|
||||
* Class CreateDiscordThread.
|
||||
*/
|
||||
class CreateDiscordThread extends BaseCreateResource
|
||||
{
|
||||
protected static string $resource = DiscordThread::class;
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Filament\Resources\Discord\DiscordThread\Pages;
|
||||
|
||||
use App\Filament\Resources\Discord\DiscordThread;
|
||||
use App\Filament\Resources\Base\BaseEditResource;
|
||||
|
||||
/**
|
||||
* Class EditDiscordThread.
|
||||
*/
|
||||
class EditDiscordThread extends BaseEditResource
|
||||
{
|
||||
protected static string $resource = DiscordThread::class;
|
||||
|
||||
/**
|
||||
* Get the header actions available.
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getHeaderActions(),
|
||||
[],
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -23,9 +23,8 @@ class ListDiscordThreads extends BaseListResources
|
||||
*/
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getHeaderActions(),
|
||||
[],
|
||||
);
|
||||
return [
|
||||
...parent::getHeaderActions(),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,9 +23,8 @@ class ViewDiscordThread extends BaseViewResource
|
||||
*/
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getHeaderActions(),
|
||||
[],
|
||||
);
|
||||
return [
|
||||
...parent::getHeaderActions(),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,13 +4,10 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Filament\Resources\Document;
|
||||
|
||||
use App\Enums\Http\Api\Filter\ComparisonOperator;
|
||||
use App\Filament\Components\Columns\TextColumn;
|
||||
use App\Filament\Components\Fields\Select;
|
||||
use App\Filament\Components\Infolist\TextEntry;
|
||||
use App\Filament\Resources\BaseResource;
|
||||
use App\Filament\Resources\Document\Page\Pages\CreatePage;
|
||||
use App\Filament\Resources\Document\Page\Pages\EditPage;
|
||||
use App\Filament\Resources\Document\Page\Pages\ListPages;
|
||||
use App\Filament\Resources\Document\Page\Pages\ViewPage;
|
||||
use App\Models\Document\Page as PageModel;
|
||||
@@ -22,10 +19,7 @@ use Filament\Forms\Set;
|
||||
use Filament\Infolists\Components\Section;
|
||||
use Filament\Infolists\Infolist;
|
||||
use Filament\Resources\RelationManagers\RelationGroup;
|
||||
use Filament\Tables\Filters\SelectFilter;
|
||||
use Filament\Tables\Table;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Support\Arr;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
/**
|
||||
@@ -92,8 +86,6 @@ class Page extends BaseResource
|
||||
* Get the slug (URI key) for the resource.
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public static function getRecordSlug(): string
|
||||
{
|
||||
@@ -275,12 +267,9 @@ class Page extends BaseResource
|
||||
public static function getRelations(): array
|
||||
{
|
||||
return [
|
||||
RelationGroup::make(static::getLabel(),
|
||||
array_merge(
|
||||
[],
|
||||
parent::getBaseRelations(),
|
||||
)
|
||||
),
|
||||
RelationGroup::make(static::getLabel(),[
|
||||
...parent::getBaseRelations(),
|
||||
]),
|
||||
];
|
||||
}
|
||||
|
||||
@@ -291,15 +280,9 @@ class Page extends BaseResource
|
||||
*/
|
||||
public static function getFilters(): array
|
||||
{
|
||||
return array_merge(
|
||||
[
|
||||
SelectFilter::make('section')
|
||||
->label(__('filament.fields.page.section.name'))
|
||||
->options(PageModel::getSections())
|
||||
->modifyQueryUsing(fn (Builder $query, array $state) => $query->where(PageModel::ATTRIBUTE_SLUG, ComparisonOperator::LIKE->value, '%' . Arr::get($state, 'value') . '%')),
|
||||
],
|
||||
parent::getFilters(),
|
||||
);
|
||||
return [
|
||||
...parent::getFilters(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -309,10 +292,9 @@ class Page extends BaseResource
|
||||
*/
|
||||
public static function getActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getActions(),
|
||||
[],
|
||||
);
|
||||
return [
|
||||
...parent::getActions(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -323,10 +305,9 @@ class Page extends BaseResource
|
||||
*/
|
||||
public static function getBulkActions(?array $actionsIncludedInGroup = []): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getBulkActions(),
|
||||
[],
|
||||
);
|
||||
return [
|
||||
...parent::getBulkActions(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -336,10 +317,9 @@ class Page extends BaseResource
|
||||
*/
|
||||
public static function getTableActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getTableActions(),
|
||||
[],
|
||||
);
|
||||
return [
|
||||
...parent::getTableActions(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -353,9 +333,7 @@ class Page extends BaseResource
|
||||
{
|
||||
return [
|
||||
'index' => ListPages::route('/'),
|
||||
'create' => CreatePage::route('/create'),
|
||||
'view' => ViewPage::route('/{record:page_id}'),
|
||||
'edit' => EditPage::route('/{record:page_id}/edit'),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Filament\Resources\Document\Page\Pages;
|
||||
|
||||
use App\Filament\Resources\Base\BaseCreateResource;
|
||||
use App\Filament\Resources\Document\Page;
|
||||
|
||||
/**
|
||||
* Class CreatePage.
|
||||
*/
|
||||
class CreatePage extends BaseCreateResource
|
||||
{
|
||||
protected static string $resource = Page::class;
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Filament\Resources\Document\Page\Pages;
|
||||
|
||||
use App\Filament\Resources\Document\Page;
|
||||
use App\Filament\Resources\Base\BaseEditResource;
|
||||
|
||||
/**
|
||||
* Class EditPage.
|
||||
*/
|
||||
class EditPage extends BaseEditResource
|
||||
{
|
||||
protected static string $resource = Page::class;
|
||||
|
||||
/**
|
||||
* Get the header actions available.
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getHeaderActions(),
|
||||
[],
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -23,9 +23,8 @@ class ListPages extends BaseListResources
|
||||
*/
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getHeaderActions(),
|
||||
[],
|
||||
);
|
||||
return [
|
||||
...parent::getHeaderActions(),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,9 +23,8 @@ class ViewPage extends BaseViewResource
|
||||
*/
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getHeaderActions(),
|
||||
[],
|
||||
);
|
||||
return [
|
||||
...parent::getHeaderActions(),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
+15
-27
@@ -12,7 +12,6 @@ use App\Filament\Components\Fields\Select;
|
||||
use App\Filament\Components\Infolist\BelongsToEntry;
|
||||
use App\Filament\Components\Infolist\TextEntry;
|
||||
use App\Filament\Resources\BaseResource;
|
||||
use App\Filament\Resources\List\External\ExternalEntry\Pages\EditExternalEntry;
|
||||
use App\Filament\Resources\List\External\ExternalEntry\Pages\ListExternalEntries;
|
||||
use App\Filament\Resources\List\External\ExternalEntry\Pages\ViewExternalEntry;
|
||||
use App\Filament\Resources\List\External\RelationManagers\ExternalEntryExternalProfileRelationManager;
|
||||
@@ -95,8 +94,6 @@ class ExternalEntry extends BaseResource
|
||||
* Get the slug (URI key) for the resource.
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public static function getRecordSlug(): string
|
||||
{
|
||||
@@ -240,13 +237,9 @@ class ExternalEntry extends BaseResource
|
||||
public static function getRelations(): array
|
||||
{
|
||||
return [
|
||||
RelationGroup::make(
|
||||
static::getLabel(),
|
||||
array_merge(
|
||||
[],
|
||||
parent::getBaseRelations(),
|
||||
)
|
||||
),
|
||||
RelationGroup::make(static::getLabel(), [
|
||||
...parent::getBaseRelations(),
|
||||
]),
|
||||
];
|
||||
}
|
||||
|
||||
@@ -257,10 +250,9 @@ class ExternalEntry extends BaseResource
|
||||
*/
|
||||
public static function getFilters(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getFilters(),
|
||||
[]
|
||||
);
|
||||
return [
|
||||
...parent::getFilters(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -270,10 +262,9 @@ class ExternalEntry extends BaseResource
|
||||
*/
|
||||
public static function getActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getActions(),
|
||||
[],
|
||||
);
|
||||
return [
|
||||
...parent::getActions(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -284,10 +275,9 @@ class ExternalEntry extends BaseResource
|
||||
*/
|
||||
public static function getBulkActions(?array $actionsIncludedInGroup = []): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getBulkActions(),
|
||||
[],
|
||||
);
|
||||
return [
|
||||
...parent::getBulkActions(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -297,10 +287,9 @@ class ExternalEntry extends BaseResource
|
||||
*/
|
||||
public static function getTableActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getTableActions(),
|
||||
[],
|
||||
);
|
||||
return [
|
||||
...parent::getTableActions(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -314,7 +303,6 @@ class ExternalEntry extends BaseResource
|
||||
{
|
||||
return [
|
||||
'index' => ListExternalEntries::route('/'),
|
||||
'edit' => EditExternalEntry::route('/{record:entry_id}/edit'),
|
||||
'view' => ViewExternalEntry::route('/{record:entry_id}'),
|
||||
];
|
||||
}
|
||||
|
||||
-31
@@ -1,31 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Filament\Resources\List\External\ExternalEntry\Pages;
|
||||
|
||||
use App\Filament\Resources\List\External\ExternalEntry;
|
||||
use App\Filament\Resources\Base\BaseEditResource;
|
||||
|
||||
/**
|
||||
* Class EditExternalEntry.
|
||||
*/
|
||||
class EditExternalEntry extends BaseEditResource
|
||||
{
|
||||
protected static string $resource = ExternalEntry::class;
|
||||
|
||||
/**
|
||||
* Get the header actions available.
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getHeaderActions(),
|
||||
[],
|
||||
);
|
||||
}
|
||||
}
|
||||
+3
-4
@@ -23,9 +23,8 @@ class ViewExternalEntry extends BaseViewResource
|
||||
*/
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getHeaderActions(),
|
||||
[],
|
||||
);
|
||||
return [
|
||||
...parent::getHeaderActions(),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Filament\Resources\List\External\Pages;
|
||||
|
||||
use App\Filament\Resources\Base\BaseCreateResource;
|
||||
use App\Filament\Resources\List\ExternalProfile;
|
||||
|
||||
/**
|
||||
* Class CreateExternalProfile.
|
||||
*/
|
||||
class CreateExternalProfile extends BaseCreateResource
|
||||
{
|
||||
protected static string $resource = ExternalProfile::class;
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Filament\Resources\List\External\Pages;
|
||||
|
||||
use App\Filament\HeaderActions\Models\List\External\SyncExternalProfileHeaderAction;
|
||||
use App\Filament\Resources\List\ExternalProfile;
|
||||
use App\Filament\Resources\Base\BaseEditResource;
|
||||
use Filament\Actions\ActionGroup;
|
||||
|
||||
/**
|
||||
* Class EditExternalProfile.
|
||||
*/
|
||||
class EditExternalProfile extends BaseEditResource
|
||||
{
|
||||
protected static string $resource = ExternalProfile::class;
|
||||
|
||||
/**
|
||||
* Get the header actions available.
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
...parent::getHeaderActions(),
|
||||
|
||||
ActionGroup::make([
|
||||
SyncExternalProfileHeaderAction::make('sync-profile'),
|
||||
]),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -25,10 +25,9 @@ class ListExternalProfiles extends BaseListResources
|
||||
*/
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getHeaderActions(),
|
||||
[],
|
||||
);
|
||||
return [
|
||||
...parent::getHeaderActions(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -4,8 +4,10 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Filament\Resources\List\External\Pages;
|
||||
|
||||
use App\Filament\HeaderActions\Models\List\External\SyncExternalProfileHeaderAction;
|
||||
use App\Filament\Resources\Base\BaseViewResource;
|
||||
use App\Filament\Resources\List\ExternalProfile;
|
||||
use Filament\Actions\ActionGroup;
|
||||
|
||||
/**
|
||||
* Class ViewExternalProfile.
|
||||
@@ -23,9 +25,12 @@ class ViewExternalProfile extends BaseViewResource
|
||||
*/
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getHeaderActions(),
|
||||
[],
|
||||
);
|
||||
return [
|
||||
...parent::getHeaderActions(),
|
||||
|
||||
ActionGroup::make([
|
||||
SyncExternalProfileHeaderAction::make('sync-profile'),
|
||||
]),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
+14
-17
@@ -44,10 +44,9 @@ class ExternalEntryExternalProfileRelationManager extends ExternalEntryRelationM
|
||||
*/
|
||||
public static function getFilters(): array
|
||||
{
|
||||
return array_merge(
|
||||
[],
|
||||
parent::getFilters(),
|
||||
);
|
||||
return [
|
||||
...parent::getFilters(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -57,10 +56,9 @@ class ExternalEntryExternalProfileRelationManager extends ExternalEntryRelationM
|
||||
*/
|
||||
public static function getActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getActions(),
|
||||
[],
|
||||
);
|
||||
return [
|
||||
...parent::getActions(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -71,22 +69,21 @@ class ExternalEntryExternalProfileRelationManager extends ExternalEntryRelationM
|
||||
*/
|
||||
public static function getBulkActions(?array $actionsIncludedInGroup = []): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getBulkActions(),
|
||||
[],
|
||||
);
|
||||
return [
|
||||
...parent::getBulkActions(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the header actions available for the relation. These are merged with the table actions of the resources.
|
||||
* Get the header actions available for the relation.
|
||||
* These are merged with the table actions of the resources.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getHeaderActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getHeaderActions(),
|
||||
[],
|
||||
);
|
||||
return [
|
||||
...parent::getHeaderActions(),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,8 +14,6 @@ use App\Filament\Components\Infolist\BelongsToEntry;
|
||||
use App\Filament\Components\Infolist\TextEntry;
|
||||
use App\Filament\Resources\Auth\User;
|
||||
use App\Filament\Resources\BaseResource;
|
||||
use App\Filament\Resources\List\External\Pages\CreateExternalProfile;
|
||||
use App\Filament\Resources\List\External\Pages\EditExternalProfile;
|
||||
use App\Filament\Resources\List\External\Pages\ListExternalProfiles;
|
||||
use App\Filament\Resources\List\External\Pages\ViewExternalProfile;
|
||||
use App\Filament\Resources\List\External\RelationManagers\ExternalEntryExternalProfileRelationManager;
|
||||
@@ -93,8 +91,6 @@ class ExternalProfile extends BaseResource
|
||||
* Get the slug (URI key) for the resource.
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public static function getRecordSlug(): string
|
||||
{
|
||||
@@ -242,15 +238,11 @@ class ExternalProfile extends BaseResource
|
||||
public static function getRelations(): array
|
||||
{
|
||||
return [
|
||||
RelationGroup::make(
|
||||
static::getLabel(),
|
||||
array_merge(
|
||||
[
|
||||
ExternalEntryExternalProfileRelationManager::class,
|
||||
],
|
||||
parent::getBaseRelations(),
|
||||
)
|
||||
),
|
||||
RelationGroup::make(static::getLabel(), [
|
||||
ExternalEntryExternalProfileRelationManager::class,
|
||||
|
||||
...parent::getBaseRelations(),
|
||||
]),
|
||||
];
|
||||
}
|
||||
|
||||
@@ -261,10 +253,9 @@ class ExternalProfile extends BaseResource
|
||||
*/
|
||||
public static function getFilters(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getFilters(),
|
||||
[]
|
||||
);
|
||||
return [
|
||||
...parent::getFilters(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -274,10 +265,9 @@ class ExternalProfile extends BaseResource
|
||||
*/
|
||||
public static function getActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getActions(),
|
||||
[],
|
||||
);
|
||||
return [
|
||||
...parent::getActions(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -288,10 +278,9 @@ class ExternalProfile extends BaseResource
|
||||
*/
|
||||
public static function getBulkActions(?array $actionsIncludedInGroup = []): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getBulkActions(),
|
||||
[],
|
||||
);
|
||||
return [
|
||||
...parent::getBulkActions(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -301,10 +290,9 @@ class ExternalProfile extends BaseResource
|
||||
*/
|
||||
public static function getTableActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getTableActions(),
|
||||
[],
|
||||
);
|
||||
return [
|
||||
...parent::getTableActions(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -318,9 +306,7 @@ class ExternalProfile extends BaseResource
|
||||
{
|
||||
return [
|
||||
'index' => ListExternalProfiles::route('/'),
|
||||
'create' => CreateExternalProfile::route('/create'),
|
||||
'view' => ViewExternalProfile::route('/{record:profile_id}'),
|
||||
'edit' => EditExternalProfile::route('/{record:profile_id}/edit'),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,8 +14,6 @@ use App\Filament\Components\Infolist\BelongsToEntry;
|
||||
use App\Filament\Components\Infolist\TextEntry;
|
||||
use App\Filament\Resources\Auth\User as UserResource;
|
||||
use App\Filament\Resources\BaseResource;
|
||||
use App\Filament\Resources\List\Playlist\Pages\CreatePlaylist;
|
||||
use App\Filament\Resources\List\Playlist\Pages\EditPlaylist;
|
||||
use App\Filament\Resources\List\Playlist\Pages\ListPlaylists;
|
||||
use App\Filament\Resources\List\Playlist\Pages\ViewPlaylist;
|
||||
use App\Filament\Resources\List\Playlist\RelationManagers\ImagePlaylistRelationManager;
|
||||
@@ -96,8 +94,6 @@ class Playlist extends BaseResource
|
||||
* Get the slug (URI key) for the resource.
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public static function getRecordSlug(): string
|
||||
{
|
||||
@@ -290,15 +286,12 @@ class Playlist extends BaseResource
|
||||
public static function getRelations(): array
|
||||
{
|
||||
return [
|
||||
RelationGroup::make(static::getLabel(),
|
||||
array_merge(
|
||||
[
|
||||
ImagePlaylistRelationManager::class,
|
||||
TrackPlaylistRelationManager::class,
|
||||
],
|
||||
parent::getBaseRelations(),
|
||||
)
|
||||
),
|
||||
RelationGroup::make(static::getLabel(), [
|
||||
ImagePlaylistRelationManager::class,
|
||||
TrackPlaylistRelationManager::class,
|
||||
|
||||
...parent::getBaseRelations(),
|
||||
]),
|
||||
];
|
||||
}
|
||||
|
||||
@@ -309,10 +302,9 @@ class Playlist extends BaseResource
|
||||
*/
|
||||
public static function getFilters(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getFilters(),
|
||||
[]
|
||||
);
|
||||
return [
|
||||
...parent::getFilters(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -322,14 +314,13 @@ class Playlist extends BaseResource
|
||||
*/
|
||||
public static function getActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getActions(),
|
||||
[
|
||||
AssignHashidsAction::make('assign-hashids')
|
||||
->setConnection('playlists')
|
||||
->authorize('update', PlaylistModel::class),
|
||||
],
|
||||
);
|
||||
return [
|
||||
...parent::getActions(),
|
||||
|
||||
AssignHashidsAction::make('assign-hashids')
|
||||
->setConnection('playlists')
|
||||
->authorize('update', PlaylistModel::class),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -340,10 +331,9 @@ class Playlist extends BaseResource
|
||||
*/
|
||||
public static function getBulkActions(?array $actionsIncludedInGroup = []): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getBulkActions(),
|
||||
[],
|
||||
);
|
||||
return [
|
||||
...parent::getBulkActions(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -353,10 +343,9 @@ class Playlist extends BaseResource
|
||||
*/
|
||||
public static function getTableActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getTableActions(),
|
||||
[],
|
||||
);
|
||||
return [
|
||||
...parent::getTableActions(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -370,9 +359,7 @@ class Playlist extends BaseResource
|
||||
{
|
||||
return [
|
||||
'index' => ListPlaylists::route('/'),
|
||||
'create' => CreatePlaylist::route('/create'),
|
||||
'view' => ViewPlaylist::route('/{record:playlist_id}'),
|
||||
'edit' => EditPlaylist::route('/{record:playlist_id}/edit'),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Filament\Resources\List\Playlist\Pages;
|
||||
|
||||
use App\Filament\Resources\Base\BaseCreateResource;
|
||||
use App\Filament\Resources\List\Playlist;
|
||||
|
||||
/**
|
||||
* Class CreatePlaylist.
|
||||
*/
|
||||
class CreatePlaylist extends BaseCreateResource
|
||||
{
|
||||
protected static string $resource = Playlist::class;
|
||||
}
|
||||
@@ -1,42 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Filament\Resources\List\Playlist\Pages;
|
||||
|
||||
use App\Filament\HeaderActions\Models\List\AssignHashidsHeaderAction;
|
||||
use App\Filament\HeaderActions\Models\List\FixPlaylistHeaderAction;
|
||||
use App\Filament\Resources\List\Playlist;
|
||||
use App\Filament\Resources\Base\BaseEditResource;
|
||||
use App\Models\List\Playlist as PlaylistModel;
|
||||
use Filament\Actions\ActionGroup;
|
||||
|
||||
/**
|
||||
* Class EditPlaylist.
|
||||
*/
|
||||
class EditPlaylist extends BaseEditResource
|
||||
{
|
||||
protected static string $resource = Playlist::class;
|
||||
|
||||
/**
|
||||
* Get the header actions available.
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
...parent::getHeaderActions(),
|
||||
|
||||
ActionGroup::make([
|
||||
AssignHashidsHeaderAction::make('assign-hashids')
|
||||
->setConnection('playlists')
|
||||
->authorize('update', PlaylistModel::class),
|
||||
|
||||
FixPlaylistHeaderAction::make('fix-playlist'),
|
||||
]),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -25,10 +25,9 @@ class ListPlaylists extends BaseListResources
|
||||
*/
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getHeaderActions(),
|
||||
[],
|
||||
);
|
||||
return [
|
||||
...parent::getHeaderActions(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -4,8 +4,12 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Filament\Resources\List\Playlist\Pages;
|
||||
|
||||
use App\Filament\HeaderActions\Models\List\AssignHashidsHeaderAction;
|
||||
use App\Filament\HeaderActions\Models\List\FixPlaylistHeaderAction;
|
||||
use App\Filament\Resources\Base\BaseViewResource;
|
||||
use App\Filament\Resources\List\Playlist;
|
||||
use App\Models\List\Playlist as PlaylistModel;
|
||||
use Filament\Actions\ActionGroup;
|
||||
|
||||
/**
|
||||
* Class ViewPlaylist.
|
||||
@@ -23,9 +27,16 @@ class ViewPlaylist extends BaseViewResource
|
||||
*/
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getHeaderActions(),
|
||||
[],
|
||||
);
|
||||
return [
|
||||
...parent::getHeaderActions(),
|
||||
|
||||
ActionGroup::make([
|
||||
AssignHashidsHeaderAction::make('assign-hashids')
|
||||
->setConnection('playlists')
|
||||
->authorize('update', PlaylistModel::class),
|
||||
|
||||
FixPlaylistHeaderAction::make('fix-playlist'),
|
||||
]),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
+14
-17
@@ -44,10 +44,9 @@ class ImagePlaylistRelationManager extends ImageRelationManager
|
||||
*/
|
||||
public static function getFilters(): array
|
||||
{
|
||||
return array_merge(
|
||||
[],
|
||||
parent::getFilters(),
|
||||
);
|
||||
return [
|
||||
...parent::getFilters(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -57,10 +56,9 @@ class ImagePlaylistRelationManager extends ImageRelationManager
|
||||
*/
|
||||
public static function getActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getActions(),
|
||||
[],
|
||||
);
|
||||
return [
|
||||
...parent::getActions(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -71,22 +69,21 @@ class ImagePlaylistRelationManager extends ImageRelationManager
|
||||
*/
|
||||
public static function getBulkActions(?array $actionsIncludedInGroup = []): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getBulkActions(),
|
||||
[],
|
||||
);
|
||||
return [
|
||||
...parent::getBulkActions(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the header actions available for the relation. These are merged with the table actions of the resources.
|
||||
* Get the header actions available for the relation.
|
||||
* These are merged with the table actions of the resources.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getHeaderActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getHeaderActions(),
|
||||
[],
|
||||
);
|
||||
return [
|
||||
...parent::getHeaderActions(),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
+14
-17
@@ -44,10 +44,9 @@ class TrackPlaylistRelationManager extends TrackRelationManager
|
||||
*/
|
||||
public static function getFilters(): array
|
||||
{
|
||||
return array_merge(
|
||||
[],
|
||||
parent::getFilters(),
|
||||
);
|
||||
return [
|
||||
...parent::getFilters(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -57,10 +56,9 @@ class TrackPlaylistRelationManager extends TrackRelationManager
|
||||
*/
|
||||
public static function getActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getActions(),
|
||||
[],
|
||||
);
|
||||
return [
|
||||
...parent::getActions(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -71,22 +69,21 @@ class TrackPlaylistRelationManager extends TrackRelationManager
|
||||
*/
|
||||
public static function getBulkActions(?array $actionsIncludedInGroup = []): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getBulkActions(),
|
||||
[],
|
||||
);
|
||||
return [
|
||||
...parent::getBulkActions(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the header actions available for the relation. These are merged with the table actions of the resources.
|
||||
* Get the header actions available for the relation.
|
||||
* These are merged with the table actions of the resources.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getHeaderActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getHeaderActions(),
|
||||
[],
|
||||
);
|
||||
return [
|
||||
...parent::getHeaderActions(),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,8 +14,6 @@ use App\Filament\Components\Infolist\TextEntry;
|
||||
use App\Filament\Resources\BaseResource;
|
||||
use App\Filament\Resources\List\Playlist as PlaylistResource;
|
||||
use App\Filament\Resources\List\Playlist\RelationManagers\TrackPlaylistRelationManager;
|
||||
use App\Filament\Resources\List\Playlist\Track\Pages\CreateTrack;
|
||||
use App\Filament\Resources\List\Playlist\Track\Pages\EditTrack;
|
||||
use App\Filament\Resources\List\Playlist\Track\Pages\ListTracks;
|
||||
use App\Filament\Resources\List\Playlist\Track\Pages\ViewTrack;
|
||||
use App\Filament\Resources\Wiki\Anime\Theme\Entry;
|
||||
@@ -99,8 +97,6 @@ class Track extends BaseResource
|
||||
* Get the slug (URI key) for the resource.
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public static function getRecordSlug(): string
|
||||
{
|
||||
@@ -293,13 +289,9 @@ class Track extends BaseResource
|
||||
public static function getRelations(): array
|
||||
{
|
||||
return [
|
||||
RelationGroup::make(
|
||||
static::getLabel(),
|
||||
array_merge(
|
||||
[],
|
||||
parent::getBaseRelations(),
|
||||
)
|
||||
),
|
||||
RelationGroup::make(static::getLabel(), [
|
||||
...parent::getBaseRelations(),
|
||||
]),
|
||||
];
|
||||
}
|
||||
|
||||
@@ -310,10 +302,9 @@ class Track extends BaseResource
|
||||
*/
|
||||
public static function getFilters(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getFilters(),
|
||||
[]
|
||||
);
|
||||
return [
|
||||
...parent::getFilters(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -323,14 +314,13 @@ class Track extends BaseResource
|
||||
*/
|
||||
public static function getActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getActions(),
|
||||
[
|
||||
AssignHashidsAction::make('assign-hashids')
|
||||
->setConnection('playlists')
|
||||
->authorize('update', TrackModel::class),
|
||||
],
|
||||
);
|
||||
return [
|
||||
...parent::getActions(),
|
||||
|
||||
AssignHashidsAction::make('assign-hashids')
|
||||
->setConnection('playlists')
|
||||
->authorize('update', TrackModel::class),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -341,10 +331,9 @@ class Track extends BaseResource
|
||||
*/
|
||||
public static function getBulkActions(?array $actionsIncludedInGroup = []): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getBulkActions(),
|
||||
[],
|
||||
);
|
||||
return [
|
||||
...parent::getBulkActions(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -354,10 +343,9 @@ class Track extends BaseResource
|
||||
*/
|
||||
public static function getTableActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getTableActions(),
|
||||
[],
|
||||
);
|
||||
return [
|
||||
...parent::getTableActions(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -371,9 +359,7 @@ class Track extends BaseResource
|
||||
{
|
||||
return [
|
||||
'index' => ListTracks::route('/'),
|
||||
'create' => CreateTrack::route('/create'),
|
||||
'view' => ViewTrack::route('/{record:track_id}'),
|
||||
'edit' => EditTrack::route('/{record:track_id}/edit'),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Filament\Resources\List\Playlist\Track\Pages;
|
||||
|
||||
use App\Filament\Resources\Base\BaseCreateResource;
|
||||
use App\Filament\Resources\List\Playlist\Track;
|
||||
|
||||
/**
|
||||
* Class CreateTrack.
|
||||
*/
|
||||
class CreateTrack extends BaseCreateResource
|
||||
{
|
||||
protected static string $resource = Track::class;
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Filament\Resources\List\Playlist\Track\Pages;
|
||||
|
||||
use App\Filament\HeaderActions\Models\List\AssignHashidsHeaderAction;
|
||||
use App\Filament\Resources\List\Playlist\Track;
|
||||
use App\Filament\Resources\Base\BaseEditResource;
|
||||
use App\Models\List\Playlist\PlaylistTrack;
|
||||
|
||||
/**
|
||||
* Class EditTrack.
|
||||
*/
|
||||
class EditTrack extends BaseEditResource
|
||||
{
|
||||
protected static string $resource = Track::class;
|
||||
|
||||
/**
|
||||
* Get the header actions available.
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getHeaderActions(),
|
||||
[
|
||||
AssignHashidsHeaderAction::make('assign-hashids')
|
||||
->setConnection('playlists')
|
||||
->authorize('update', PlaylistTrack::class)
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -23,9 +23,8 @@ class ListTracks extends BaseListResources
|
||||
*/
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getHeaderActions(),
|
||||
[],
|
||||
);
|
||||
return [
|
||||
...parent::getHeaderActions(),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,8 +4,10 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Filament\Resources\List\Playlist\Track\Pages;
|
||||
|
||||
use App\Filament\HeaderActions\Models\List\AssignHashidsHeaderAction;
|
||||
use App\Filament\Resources\Base\BaseViewResource;
|
||||
use App\Filament\Resources\List\Playlist\Track;
|
||||
use App\Models\List\Playlist\PlaylistTrack;
|
||||
|
||||
/**
|
||||
* Class ViewTrack.
|
||||
@@ -23,9 +25,12 @@ class ViewTrack extends BaseViewResource
|
||||
*/
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return array_merge(
|
||||
parent::getHeaderActions(),
|
||||
[],
|
||||
);
|
||||
return [
|
||||
...parent::getHeaderActions(),
|
||||
|
||||
AssignHashidsHeaderAction::make('assign-hashids')
|
||||
->setConnection('playlists')
|
||||
->authorize('update', PlaylistTrack::class)
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user