schema([ TextInput::make(ScriptModel::ATTRIBUTE_PATH) ->label(__('filament.fields.video_script.path')) ->hiddenOn(['create', 'edit']), ]) ->columns(1); } /** * The index page of the resource. * * @param Table $table * @return Table * * @noinspection PhpMissingParentCallCommonInspection */ public static function table(Table $table): Table { return parent::table($table) ->columns([ TextColumn::make(ScriptModel::ATTRIBUTE_ID) ->label(__('filament.fields.base.id')) ->sortable(), TextColumn::make(ScriptModel::ATTRIBUTE_PATH) ->label(__('filament.fields.video_script.path')) ->sortable() ->copyableWithMessage(), ]); } /** * Get the infolist available for the resource. * * @param Infolist $infolist * @return Infolist * * @noinspection PhpMissingParentCallCommonInspection */ public static function infolist(Infolist $infolist): Infolist { return $infolist ->schema([ Section::make(__('filament.fields.base.timestamps')) ->schema(parent::timestamps()), ]); } /** * Get the relationships available for the resource. * * @return array * * @noinspection PhpMissingParentCallCommonInspection */ public static function getRelations(): array { return [ RelationGroup::make(static::getLabel(), array_merge( [], parent::getBaseRelations(), ) ), ]; } /** * Get the filters available for the resource. * * @return array * * @noinspection PhpMissingParentCallCommonInspection */ public static function getFilters(): array { return array_merge( parent::getFilters(), [] ); } /** * Get the actions available for the resource. * * @return array * * @noinspection PhpMissingParentCallCommonInspection */ public static function getActions(): array { return array_merge( parent::getActions(), [ ActionGroup::make([ MoveScriptAction::make('move-script'), DeleteScriptAction::make('delete-script'), ]), ], ); } /** * Get the bulk actions available for the resource. * * @return array * * @noinspection PhpMissingParentCallCommonInspection */ public static function getBulkActions(): array { return array_merge( parent::getBulkActions(), [ DeleteScriptBulkAction::make('delete-script'), ], ); } /** * Get the header actions available for the resource. * * @return array * * @noinspection PhpMissingParentCallCommonInspection */ public static function getHeaderActions(): array { return [ ActionGroup::make([ UploadScriptTableAction::make('upload-script'), ReconcileScriptTableAction::make('reconcile-script'), ]), ]; } /** * Determine whether the related model can be created. * * @return bool */ public static function canCreate(): bool { return false; } /** * Get the pages available for the resource. * * @return array * * @noinspection PhpMissingParentCallCommonInspection */ public static function getPages(): array { return [ 'index' => ListScripts::route('/'), 'view' => ViewScript::route('/{record:script_id}'), 'edit' => EditScript::route('/{record:script_id}/edit'), ]; } }