I have an application where dates are currently stored in the database as UTC. However the audience is primarily UK based so I need to convert all dates back to 'Europe/London' time when displaying or searching using eloquent.
I know I can change the default timezone in app.config which would solve the problem:
'timezone' => 'Europe/London'
However I want to keep it as UTC if eventually the app caters to a more global audience.
Now I know I can change the dates using carbon as follows:
$model->start_at->tz('Europe/London')
Without having to append tz('Europe/London')
to every date, is there a way to default them to 'Europe/London' whilst keeping the app.config timezone setting to UTC?
Also note some dates are user entered and so for now using the 'Europe/London' timezone would suffice but eventually, for a global audience this would need to be presented back to the user in their local timezone and for working out eloquent queries where dates need to be compared. So do I convert them to UTC when saving to the database and convert back to local timezone when retrieving them?