diff --git a/src/PassGenerator.php b/src/PassGenerator.php index 6b0c205..206108a 100644 --- a/src/PassGenerator.php +++ b/src/PassGenerator.php @@ -167,19 +167,23 @@ public function __destruct() * Add an asset to the pass. Use this function to add images to the pass. * * @param string $assetPath + * @param string $name * * @throws \InvalidArgumentException * * @return void */ - public function addAsset($assetPath) + public function addAsset($assetPath, $name = null) { if (is_file($assetPath)) { - $this->assets[basename($assetPath)] = $assetPath; - + if(empty($name)) { + $this->assets[basename($assetPath)] = $assetPath; + } else { + $this->assets[$name] = $assetPath; + } return; } - + throw new InvalidArgumentException("The file $assetPath does NOT exist"); }