Welcome Guest, Not a member yet? Register   Sign In
Entity Classes and Time
#1

(This post was last modified: 02-03-2025, 02:54 PM by grimpirate.)

I'm confused on how best to proceed. I created a Model with an $allowedFields 'date_request'. I created an Entity class that has 'date_request' as one of its $attributes. My confusion stems from two places in the docs: In using my 'date_request' field should I define it as a 'datetime' type in the $casts array or should I place it into the $dates array to mutate it automatically? Neither? Both?

What are the issues/benefits of  these approaches in terms of the Entity and Time classes?

Why bother with $dates at all if I have the ability to mutate via cast; more peculiarly if I can specify a cast that is nullable?
Reply


Messages In This Thread
Entity Classes and Time - by grimpirate - 02-03-2025, 12:44 PM
RE: Entity Classes and Time - by ozornick - 02-04-2025, 11:32 AM
RE: Entity Classes and Time - by grimpirate - 02-04-2025, 04:22 PM
RE: Entity Classes and Time - by ozornick - 02-04-2025, 11:14 PM



Theme © iAndrew 2016 - Forum software by © MyBB