public function copyCoverFile($srcPath) { $extension = pathinfo($srcPath, PATHINFO_EXTENSION); $destPath = $this->generateRandomCoverPath($extension); copy($srcPath, $destPath); $this->update(['cover' => basename($destPath)]); }