Laravel 观察者事件未显示所有属性

Laravel observer events not showing all the attributes

我有一个观察者有 2 个事件

class OrderObserver
{
    public function created($model)
    {     
        Log::alert("observer" , [$model]);      
    }
    
    public function updated($model)
    {
        Log::alert("observer" , [$model]);        
    }
}

但是在创建的事件中我获得的属性较少,例如我没有获得 statusid 等。我做错了什么?

这是日志的输出

创建日志

[2021-10-25 17:22:39] local.ALERT: observer [{"App\Models\Order":{"customer_id":"1","vat":"5","payment_option":"Pay Later","created_by":5,"updated_by":5,"updated_at":"2021-10-25T17:22:39.000000Z","created_at":"2021-10-25T17:22:39.000000Z","id":61,"order_number":"6100P66C","sub_total":"0.00","discount_in_money":"0.00","vat_in_money":"0.00","total_price":"0.00","products":[]}}] 

更新日志

[2021-10-25 17:25:23] local.ALERT: observer [{"App\Models\Order":{"id":61,"address":null,"status":"Delivered","discount_type":null,"discount_amount":null,"vat":"5.00","payment_option":"Pay Later","order_mode":"pos","customer_id":1,"created_by":5,"updated_by":5,"created_at":"2021-10-25T17:22:39.000000Z","updated_at":"2021-10-25T17:25:23.000000Z","order_number":"6100P66C","payment_received":1,"sub_total":"24.98","discount_in_money":"0.00","vat_in_money":"1.25","total_price":"26.23","products":[{"id":1,"name":"Men's Shirt","image":null,"description":"All kinds of men's shirts are washed, dry cleaned and treated according to the category with different standards for each type of shirt","price":"9.99","is_package":0,"is_active":1,"product_category_id":1,"created_by":1,"updated_by":1,"created_at":"2021-07-03T13:28:15.000000Z","updated_at":"2021-07-03T13:28:15.000000Z","pivot":{"order_id":61,"product_id":1,"quantity":2,"price":"9.99","created_at":"2021-10-25T17:22:39.000000Z","updated_at":"2021-10-25T17:22:39.000000Z"}},{"id":2,"name":"Men's Trousers","image":null,"description":"All kinds of men's trousers are washed, dry cleaned and treated according to the category with different standards for each type of trousers","price":"5.00","is_package":0,"is_active":1,"product_category_id":1,"created_by":1,"updated_by":1,"created_at":"2021-07-03T13:41:38.000000Z","updated_at":"2021-07-03T13:41:38.000000Z","pivot":{"order_id":61,"product_id":2,"quantity":1,"price":"5.00","created_at":"2021-10-25T17:22:39.000000Z","updated_at":"2021-10-25T17:22:39.000000Z"}}]}}] 

created 显示模型插入数据库时​​的状态。此时不存在具有默认值的字段。

updated 显示模型在插入数据库并从数据库中提取后的状态。所有这些字段现在都存在。