I've been using DateTime columns, often with the end DateTime column being nullable (for events that really do not have a definitive end) and adding them to the $dates array on the model. That way I can easily manipulate them with Carbon.
Date and Time strategies
Hi all,
What are your strategies for dealing with dates and times on forms in Laravel? I've run into several situations where I need to store both a date and a time for a given model, (for example, a start date and a start time for an event). The first thing that always comes to mind is to use a DateTime column.
Another option is to store the date and time as separate columns in the database, but that has the potential to make queries later on harder to deal with.
Ideally, the goal is simple - give the user a simple to use date and time picker, store the selected date and time to your data store, and retrieve it later on. If the user needs to edit this data, it should be just as easy to change.
Please or to participate in this conversation.