ldc-dam/app/Models/Format.php

28 lines
504 B
PHP
Raw Normal View History

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