fixes
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user