public copyCoverFile ( string $srcPath ) | ||
$srcPath | string | The original image's full path. |
public function copyCoverFile($srcPath)
{
$extension = pathinfo($srcPath, PATHINFO_EXTENSION);
$destPath = $this->generateRandomCoverPath($extension);
copy($srcPath, $destPath);
$this->update(['cover' => basename($destPath)]);
}