#config->all() → map
Todos los ajustes, como un mapa.
Ejemplo
<config defaults="{ server: { port: 8080 } }" />
<echo>{ $config->all() }</echo>config(defaults: { server: { port: 8080 } })
echo $config->all()$config: ajustes de los archivos de configuración, los archivos .env y el entorno.
Un campo es un dato fijo sobre el valor, que se lee con un punto y sin corchetes: $value.name. Un método recibe argumentos o realiza una acción, y se llama con ->: $value->name(arguments), o con el valor encadenado: $value |> name(arguments).
config->all() → map<config defaults="{ server: { port: 8080 } }" />
<echo>{ $config->all() }</echo>config(defaults: { server: { port: 8080 } })
echo $config->all()config->environment() → string<echo>{ $config->environment() }</echo>echo $config->environment()config->get(path, default?) → anyLos argumentos pueden tener nombre: ->get(…, default: …).
<echo>{ $config->get('server.port', 8080) }</echo>echo $config->get('server.port', 8080)config->has(path) → bool<echo>{ $config->has('database.url') }</echo>echo $config->has('database.url')config->reload() → config<echo>{ $config->reload()->get('server.port', 8080) }</echo>echo $config->reload()->get('server.port', 8080)config->require(path) → any<config defaults="{ app: { name: 'Shop' } }" />
<echo>{ $config->require('app.name') }</echo>config(defaults: { app: { name: 'Shop' } })
echo $config->require('app.name')config->sources() → list<echo>{ $config->sources()->count() >= 0 }</echo>echo $config->sources()->count() >= 0->convert(from?: 'json'|yaml|'csv'|'markdown'|'latex', to?: 'json'|yaml|'csv'|html|'markdown'|'latex', header?: bool, as?: type, headers?: list, indented?: bool)->from(type: 'json'|yaml|'csv'|'markdown'|'latex', header?: bool, as?: type)->is_a(type: word)->is_null()->or(fallback)->to(type: 'json'|yaml|'csv'|html|'markdown'|'latex', headers?: list, indented?: bool)->to_string()->type()