Welcome Guest, Not a member yet? Register   Sign In
Model Update ignores null
#9

(12-31-2021, 03:55 AM)kenjis Wrote: @AngelRodriguez
iRedds's code works. I don't know why you can't update.

Problem solved:

My "Customer Entity" was:

PHP Code:
class Customer extends Entity
{
    protected $attributes = [
        'customer_id' => null,
        'customer_deleted' => null,
        'customer_deleted_at' => null,
    ];

    protected $dates = ['customer_deleted_at'];



Removing " => null", works:

PHP Code:
class Customer extends Entity
{
    protected $attributes = [
        'customer_id',
        'customer_deleted',
        'customer_deleted_at',
    ];

    protected $dates = ['customer_deleted_at'];
}

Thank you
Reply


Messages In This Thread
Model Update ignores null - by AngelRodriguez - 12-29-2021, 08:10 AM
RE: Model Update ignores null - by kenjis - 12-29-2021, 05:43 PM
RE: Model Update ignores null - by AngelRodriguez - 12-30-2021, 03:18 AM
RE: Model Update ignores null - by kenjis - 12-30-2021, 04:18 AM
RE: Model Update ignores null - by iRedds - 12-30-2021, 04:34 AM
RE: Model Update ignores null - by AngelRodriguez - 12-30-2021, 05:08 AM
RE: Model Update ignores null - by iRedds - 12-30-2021, 03:49 PM
RE: Model Update ignores null - by kenjis - 12-31-2021, 03:55 AM
RE: Model Update ignores null - by AngelRodriguez - 01-03-2022, 06:13 AM



Theme © iAndrew 2016 - Forum software by © MyBB