class ConfigurationUrlParser (View source)

Properties

static protected array<string, string> $driverAliases

The drivers aliases map.

Methods

array<string, mixed>
parseConfiguration(array<string, mixed>|string $config)

Parse the database configuration, hydrating options using a database configuration URL if possible.

array<string, mixed>
getPrimaryOptions(array<string, mixed> $url)

Get the primary database connection options.

string|null
getDriver(array<string, mixed> $url)

Get the database driver from the URL.

string|null
getDatabase(array<string, mixed> $url)

Get the database name from the URL.

array<string, mixed>
getQueryOptions(array<string, mixed> $url)

Get all of the additional database options from the query string.

array<string, mixed>
parseUrl(string $url)

Parse the string URL to an array of components.

mixed
parseStringsToNativeTypes(mixed $value)

Convert string casted values to their native types.

static array<string, string>
getDriverAliases()

Get all of the current drivers' aliases.

static void
addDriverAlias(string $alias, string $driver)

Add the given driver alias to the driver aliases array.

Details

array<string, mixed> parseConfiguration(array<string, mixed>|string $config)

Parse the database configuration, hydrating options using a database configuration URL if possible.

Parameters

array<string, mixed>|string $config

Return Value

array<string, mixed>

protected array<string, mixed> getPrimaryOptions(array<string, mixed> $url)

Get the primary database connection options.

Parameters

array<string, mixed> $url

Return Value

array<string, mixed>

protected string|null getDriver(array<string, mixed> $url)

Get the database driver from the URL.

Parameters

array<string, mixed> $url

Return Value

string|null

protected string|null getDatabase(array<string, mixed> $url)

Get the database name from the URL.

Parameters

array<string, mixed> $url

Return Value

string|null

protected array<string, mixed> getQueryOptions(array<string, mixed> $url)

Get all of the additional database options from the query string.

Parameters

array<string, mixed> $url

Return Value

array<string, mixed>

protected array<string, mixed> parseUrl(string $url)

Parse the string URL to an array of components.

Parameters

string $url

Return Value

array<string, mixed>

Exceptions

InvalidArgumentException

protected mixed parseStringsToNativeTypes(mixed $value)

Convert string casted values to their native types.

Parameters

mixed $value

Return Value

mixed

static array<string, string> getDriverAliases()

Get all of the current drivers' aliases.

Return Value

array<string, string>

static void addDriverAlias(string $alias, string $driver)

Add the given driver alias to the driver aliases array.

Parameters

string $alias
string $driver

Return Value

void

Laravel Cloud is the best place to deploy Laravel, Nuxt, Express, Hono, Node.js, Bun, Go, Flask, Python, and more, with dedicated infrastructure available on AWS through Laravel Private Cloud.