Hi all
Eventually I came across a comment on https://stackoverflow.com/questions/31895854/laravel-artisan-optimize-best-practices specifying the use of
php artisan optimize:clear
which does work as expected in my case.
Best regards
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hi all,
My project is run on Laravel 10
For some reason I need to be able to update .env's data and the corresponding config's file. I managed to do so in the controller's store method and then I called
Artisan::call("optimize");
before redirecting to the page I came from
return back()->with("success", $message);
I can see the session data if I log them before the redirection but on the page I am redirected to I don't have them any more
Furthermore If I comment the artisan call, I can see the session data displayed on the page I have been redirected but my new config is not taken into account.
How can I do then ?
Thanks in advance for your answers
Please or to participate in this conversation.