23 lines
508 B
PHP
23 lines
508 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class Reductions extends Model
|
|
{
|
|
public function products()
|
|
{
|
|
return $this->belongsToMany(Products::class, 'reduction_config', 'reduction_id', 'product_id');
|
|
}
|
|
|
|
public function notifiable()
|
|
{
|
|
return $this->morphOne(Notifications::class, 'notifiable');
|
|
}
|
|
|
|
public function ranges()
|
|
{
|
|
return $this->belongsToMany(Range::class, 'reduction_config', 'reduction_id', 'range_id');
|
|
}
|
|
}
|