2020-10-05 15:21:25 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Models;
|
|
|
|
|
|
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
|
|
|
|
|
|
class Reductions extends Model
|
|
|
|
|
{
|
2021-02-04 19:06:12 +01:00
|
|
|
public function products()
|
|
|
|
|
{
|
2021-02-19 12:21:56 +01:00
|
|
|
return $this->belongsToMany(Products::class, 'reduction_config', 'reduction_id', 'product_id');
|
2020-12-17 17:15:06 +01:00
|
|
|
}
|
|
|
|
|
|
2021-03-20 14:38:15 +01:00
|
|
|
public function notifiable()
|
|
|
|
|
{
|
2021-03-01 14:52:11 +01:00
|
|
|
return $this->morphOne(Notifications::class, 'notifiable');
|
|
|
|
|
}
|
|
|
|
|
|
2021-02-04 19:06:12 +01:00
|
|
|
public function ranges()
|
|
|
|
|
{
|
|
|
|
|
return $this->belongsToMany(Ranges::class, 'reduction_config', 'reduction_id', 'range_id');
|
2020-12-17 17:15:06 +01:00
|
|
|
}
|
2020-10-05 15:21:25 +02:00
|
|
|
}
|