add shipping rules

This commit is contained in:
Ludovic CANDELLIER
2023-07-16 14:45:42 +02:00
parent 297dcc62d2
commit 39c80ce6d1
459 changed files with 6219 additions and 5416 deletions

View File

@@ -7,13 +7,14 @@ use Illuminate\Database\Eloquent\Model;
class CustomerDelivery extends Model
{
protected $guarded = ['id'];
protected $table = 'shop_customer_deliveries';
public function customer()
{
return $this->belongsTo(Customer::class);
}
public function delivery()
{
return $this->belongsTo(Delivery::class);
@@ -21,11 +22,11 @@ class CustomerDelivery extends Model
public function scopeByCustomer($query, $customer_id)
{
return $query->where($this->table . '.customer_id', $customer_id);
return $query->where($this->table.'.customer_id', $customer_id);
}
public function scopeByDelivery($query, $customer_id)
{
return $query->where($this->table . '.delivery_id', $customer_id);
return $query->where($this->table.'.delivery_id', $customer_id);
}
}