ldc-dam/app/Models/Format.php
2022-06-20 14:04:15 +02:00

27 lines
504 B
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Format extends Model
{
/**
* The attributes that should be cast.
*
* @var array
*/
protected $casts = [
'largeur' => 'int',
'hauteur' => 'int',
'system' => 'bool',
];
/**
* The sujet that belong to the format.
*/
public function sujets()
{
return $this->belongsToMany('App\Models\Sujet', 'sujets_formats', 'format_id', 'sujet_id');
}
}