This commit is contained in:
Ludovic CANDELLIER
2022-07-04 00:35:43 +02:00
parent 573e98a2ce
commit d423fce4f5
9 changed files with 50 additions and 49 deletions

View File

@@ -18,4 +18,24 @@ class CustomerAddress extends Model
{
return $this->hasMany(Order::class);
}
public function scopeByCustomer($query, $id)
{
return $query->where('customer_id', $id);
}
public function scopeByDelivery($query)
{
return $query->byType(1);
}
public function scopeByInvoicing($query)
{
return $query->byType(2);
}
public function scopeByType($query, $id)
{
return $query->where('type', $id);
}
}