*/ class ScriptRepository extends StorageRepository { /** * The name of the disk. * * @return string */ public function disk(): string { return Config::get(VideoConstants::SCRIPT_DISK_QUALIFIED); } /** * Return the callback to filter filesystem contents. * * @return Closure(StorageAttributes): bool */ protected function filterCallback(): Closure { return fn (StorageAttributes $file) => $file->isFile() && File::extension($file->path()) === 'txt'; } /** * Map filesystem files to model. * * @return Closure(StorageAttributes): VideoScript */ protected function mapCallback(): Closure { return fn (StorageAttributes $file) => new VideoScript([ VideoScript::ATTRIBUTE_PATH => $file->path(), ]); } }