Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Abdk2r's avatar

Runtime data laravel way

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 ?

0 likes
1 reply
tykus's avatar
tykus
Best Answer
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)

Please or to participate in this conversation.