79090260

Date: 2024-10-15 13:57:19
Score: 1
Natty:
Report link

I have something like this in my Items model

public function orders()
    {
        return $this->belongsToMany(Items::class, 'item_orders', 'item_id', 'order_id')
            ->wherePivotNull('deleted_at'); // It is necessary to remove softdeletes in belongsToMany
    }
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Matias Pereira