belongsTo(OrderItem::class); } public function buyer() { return $this->belongsTo(User::class, 'buyer_id'); } public function user() { return $this->belongsTo(User::class, 'user_id'); } public function activites() { return $this->hasMany(RefundActivity::class); } public function statusBadge(): Attribute { return new Attribute(function () { $html = ''; if ($this->status == 1) { $html = '' . trans('Approved') . ''; } else if ($this->status == 2) { $html = '' . trans('Rejected') . ''; } else { $html = '' . trans('Pending') . ''; } return $html; }); } }