from(); foreach ($this->disks() as $disk) { /** @var FilesystemAdapter $fs */ $fs = Storage::disk($disk); $result = $fs->move($from, $this->to); $results[$disk] = $result; } return new MoveResults($this->model, $from, $this->to, $results); } /** * Processes to be completed after handling action. * * @param StorageResults $storageResults * @return TModel */ public function then(StorageResults $storageResults): BaseModel { return $this->update(); } /** * Get the path to move from. * * @return string */ abstract protected function from(): string; /** * Update underlying model. * We want to apply these updates through Eloquent to preserve relations when renaming. * Otherwise, reconciliation would destroy the old model and create a new model for the new name. * * @return TModel */ abstract protected function update(): BaseModel; }