ImageManager
class ImageManager extends Manager (View source)
Traits
Properties
| protected Container | $container | The container instance. |
from Manager |
| protected Repository | $config | The configuration repository instance. |
from Manager |
| protected Closure> | $customCreators | The registered custom driver creators. |
from Manager |
| protected array<string,mixed> | $drivers | The array of created "drivers". |
from Manager |
| protected Transformation>,callable>> | $transformationHandlers | The registered transformation handlers. |
Methods
Get the default image driver name.
Create a new driver instance.
Dynamically call the default driver instance.
Create an image instance from a base64 encoded string.
Create an image instance from a storage disk path.
Create the GD image driver.
Create the Imagick image driver.
Register a transformation handler for the given driver.
Apply registered transformation handlers to the given driver instance.
Details
protected Closure|null
bindCallbackToSelf(Closure $callback)
Binds the provided callback to the class instance.
__construct(Container $container)
Create a new manager instance.
string|null
getDefaultDriver()
Get the default image driver name.
mixed
driver(UnitEnum|string|null $driver = null)
Get a driver instance.
protected mixed
createDriver(string $driver)
Create a new driver instance.
protected mixed
callCustomCreator(string $driver)
Call a custom driver creator.
$this
extend(string $driver, Closure $callback)
Register a custom driver creator Closure.
array<string,mixed>
getDrivers()
Get all of the created "drivers".
Container
getContainer()
Get the container instance used by the manager.
$this
setContainer(Container $container)
Set the container instance used by the manager.
$this
forgetDrivers()
Forget all of the resolved driver instances.
mixed
__call(string $method, array<string,mixed> $parameters)
Dynamically call the default driver instance.
Image
fromBytes(string $contents)
Create an image instance from raw bytes.
Image
fromBase64(string $base64)
Create an image instance from a base64 encoded string.
Image
fromPath(string $path)
Create an image instance from a file path.
Image
fromStorage(string $path, string|null $disk = null)
Create an image instance from a storage disk path.
Image
fromUpload(UploadedFile $file)
Create an image instance from an uploaded file.
Image
fromUrl(string $url)
Create an image instance from a URL.
protected GdDriver
createGdDriver()
Create the GD image driver.
protected ImagickDriver
createImagickDriver()
Create the Imagick image driver.
ImageManager
transformUsing(string $driver, string $transformation, callable $callback)
Register a transformation handler for the given driver.
protected void
applyTransformationHandlers(string $driver, Driver $instance)
Apply registered transformation handlers to the given driver instance.