cleaning day

This commit is contained in:
ludo
2024-02-22 21:28:33 +01:00
parent 64a218afc2
commit fb6da523fa
111 changed files with 198 additions and 2456 deletions

View File

@@ -3,6 +3,9 @@
namespace App\Models\Shop;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\Relations\HasManyThrough;
class SaleChannel extends Model
{
@@ -10,27 +13,27 @@ class SaleChannel extends Model
protected $table = 'shop_sale_channels';
public function customer_sale_channels()
public function customer_sale_channels(): HasMany
{
return $this->hasMany(CustomerSaleChannel::class);
}
public function customers()
public function customers(): BelongsToMany
{
return $this->belongsToMany(Customer::class, CustomerSaleChannel::class)->wherePivotNull('deleted_at');
}
public function deliveries()
public function deliveries(): HasMany
{
return $this->hasMany(Delivery::class);
}
public function price_lists()
public function price_lists(): HasMany
{
return $this->hasMany(PriceList::class);
}
public function tariffs()
public function tariffs(): HasManyThrough
{
return $this->hasManyThrough(Tariff::class, PriceList::class, 'sale_channel_id', 'id', 'id', 'tariff_id');
}