27 lines
480 B
PHP
27 lines
480 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class Ranges extends Model
|
|
{
|
|
/**
|
|
* The attributes that should be cast.
|
|
*
|
|
* @var array
|
|
*/
|
|
protected $casts = [
|
|
'color' => HtmlColor::class
|
|
];
|
|
|
|
public function products()
|
|
{
|
|
return $this->hasMany(Products::class, 'range_id');
|
|
}
|
|
|
|
public function reductions()
|
|
{
|
|
return $this->belongsToMany(Reductions::class, 'reduction_config');
|
|
}
|
|
}
|