Level 104
You can set a config value at runtime using the config([key => value]) helper method; or Config::set(key, value). Retrieval of the value using either config(key) or Config::get(key)
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I would like to have a temporary data on my runtime.
Laravel::set('key', 'value')
Retrieve it within the same runtime
Laravel::get('key')
Anything like this exist already in Laravel ?
You can set a config value at runtime using the config([key => value]) helper method; or Config::set(key, value). Retrieval of the value using either config(key) or Config::get(key)
Please or to participate in this conversation.