ldc-legaulois/app/Models/Ranges.php
2021-02-09 18:47:01 +01:00

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');
}
}