attributes['created_at']); } public function getUpdatedAtTextAttribute() { return date('Y-m-d H:i:s', $this->attributes['updated_at']); } public function orderGoods() { return $this->hasMany(OrderGoods::class, 'order_id', 'id'); } public function market() { return $this->belongsTo(Market::class, 'market_id', 'id'); } public function orderMain() { return $this->belongsTo(OrderMain::class, 'order_main_id', 'global_order_id'); } public function user() { return $this->belongsTo(User::class, 'user_id', 'id'); } public function store() { return $this->belongsTo(Store::class, 'store_id', 'id')->withTrashed(); } }