27 lines
504 B
PHP
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');
|
|
}
|
|
}
|