LaravelConfig

Summary

No protected properties found
N/A
No private methods found
No private properties found
N/A
File
config.php
Package
Default
Class hierarchy
LaravelConfig

Tags

None found

Constants

loader

loader

The configuration loader event name.

Tags

None found

Properties

$items

$items : array

All of the loaded configuration items.

The configuration arrays are keyed by their owning bundle and file.

Type

array

Tags

None found

$cache

$cache : array

A cache of the parsed configuration items.

Type

array

Tags

None found

Methods

has()

has(string  $key) : boolean

Determine if a configuration item or file exists.

// Determine if the "session" configuration file exists $exists = Config::has('session');

// Determine if the "timezone" option exists in the configuration
$exists = Config::has('application.timezone');

Parameters

string $key

Returns

boolean

static

Tags

None found

get()

get(string  $key, mixed  $default = null) : array

Get a configuration item.

If no item is requested, the entire configuration array will be returned.

// Get the "session" configuration array $session = Config::get('session');

// Get a configuration item from a bundle's configuration file
$name = Config::get('admin::names.first');

// Get the "timezone" option from the "application" configuration file
$timezone = Config::get('application.timezone');

Parameters

string $key
mixed $default

Returns

array

static

Tags

None found

set()

set(string  $key, mixed  $value) : void

Set a configuration item's value.

// Set the "session" configuration array Config::set('session', $array);

// Set a configuration option that belongs by a bundle
Config::set('admin::names.first', 'Taylor');

// Set the "timezone" option in the "application" configuration file
Config::set('application.timezone', 'UTC');

Parameters

string $key
mixed $value

static

Tags

None found

load()

load(string  $bundle, string  $file) : boolean

Load all of the configuration items from a configuration file.

Parameters

string $bundle
string $file

Returns

boolean

static

Tags

None found

file()

file(string  $bundle, string  $file) : array

Load the configuration items from a configuration file.

Parameters

string $bundle
string $file

Returns

array

static

Tags

None found

parse()

parse(string  $key) : array

Parse a key and return its bundle, file, and key segments.

Configuration items are named using the {bundle}::{file}.{item} convention.

Parameters

string $key

Returns

array

static

Tags

None found

paths()

paths(string  $bundle) : array

Get the array of configuration paths that should be searched for a bundle.

Parameters

string $bundle

Returns

array

static

Tags

None found