I read the carbon docs, and it seems you need to use ->lt etc.
For a java developer, it is pretty shocking that php allows my totally incorrect code to run without any errors or warnings.
Anyway, I am guessing I need to do something like this:
if ($model->expire_at->lt(Carbon::now())) { }
but this gives:
Error: Call to a member function lt() on string
My database field is a timestamp.
so either I still have the wrong syntax, or eloquent is mapping timestamps to strings in the model. When I look at the expire_at field (under "attributes")in the VS Code local variables debugger view, it shows it as something like
created_at: "2017-10-18 17:59:17"
expire_at: "2017-11-22 03:52:58"
etc. Not sure if this means eloquent maps timestamps onto strings in the model, or that it is doing the java equivalent of "toString()" on it.