You can use the Laravel config helper function to set the time zone. However, this will only affect the request you receive.
config(['app.timezone' => $timezone]);
If your goal is to change once with the time zone and run each query, then how about saving the changed time zone to the database or file. Then write a query for the database or read the file in app / config.php and change the index timeline value in the file.
For example (example file):
When you change the time zone, it saves the file.
file_put_contents("path/to/file", $timezone);
And, in app/config.php
$timezone= file_get_contents("path/to/file"); return [ . . . 'timezone' => $timezone, . . . ]
source share