you can add ur custom col in table then make observer on creation to add value for this col in your conditions
May 18, 2022
5
Level 3
Set custom created_at value in Model::create()
On certain operations using Model::create() I want to set a custom creation date. But during the operation of the main functionality, it is necessary that the date, as before, would be set by itself. Those. set $timestamp = false and write your own mutator is not suitable for me as it will affect the rest of the system. How can I set this value only for a specific operation?
Level 39
Not directly possible with create, but you can change it just after
$m=Model::create(...);$m->created_at='2022-04-01 08:00:00';$m->save()
Please or to participate in this conversation.