defaultPath(); $fs = Storage::disk($this->disk()); return $form ->schema([ TextInput::make('path') ->label(__('filament.actions.storage.move.fields.path.name')) ->helperText(__('filament.actions.storage.move.fields.path.help')) ->required() ->rules(['required', 'string', 'doesnt_start_with:/', "ends_with:{$this->allowedFileExtension()}", new StorageFileDirectoryExistsRule($fs)]) ->default(fn () => $defaultPath), ]); } /** * Get the underlying storage action. * * @param BaseModel $model * @param array $fields * @return BaseMoveAction */ abstract protected function storageAction(BaseModel $model, array $fields): BaseMoveAction; /** * Resolve the default value for the path field. * * @return string|null */ abstract protected function defaultPath(): ?string; /** * The file extension that the path must end with. * * @return string */ abstract protected function allowedFileExtension(): string; }