src/UrlGenerators/UrlGeneratorFactory.php
public function create(Media $media)
    {
        $driver = $this->getDriverForDisk($media->disk);
        if (array_key_exists($driver, $this->driver_generators)) {
            $class = $this->driver_generators[$driver];

            $generator = app($class);
            $generator->setMedia($media);

            return $generator;
        }

        throw MediaUrlException::generatorNotFound($media->disk, $driver);
    }
public function create(Media $media)
    {
        $driver = $this->getDriverForDisk($media->disk);
        if (array_key_exists($driver, $this->driver_generators)) {
            $class = $this->driver_generators[$driver];

            $generator = app($class);
            $generator->setMedia($media);

            return $generator;
        }

        throw MediaUrlException::generatorNotFound($media->disk, $driver);
    }
public function create ( Media $ media ) { $ driver = $ this -> getDriverForDisk ( $ media -> disk ) ; if ( array_key_exists ( $ driver , $ this -> driver_generators ) ) { $ class = $ this -> driver_generators [ $ driver ] ; $ generator = app ( $ class ) ; $ generator -> setMedia ( $ media ) ; return $ generator ; } throw MediaUrlException :: generatorNotFound ( $ media -> disk , $ driver ) ; }
Get a UrlGenerator instance for a media.
@param  \Plank\Mediable\Media  $media
@return \Plank\Mediable\UrlGenerators\UrlGeneratorInterface
@throws \Plank\Mediable\Exceptions\MediaUrlException If no generator class has been assigned for the media's disk's driver
Get a UrlGenerator instance for a media .