2019-07-11 11:45:47 +02:00
|
|
|
<?php
|
|
|
|
|
|
2019-09-12 11:08:25 +02:00
|
|
|
namespace App\Models;
|
2019-07-11 11:45:47 +02:00
|
|
|
|
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
|
|
|
|
|
|
class Format extends Model
|
|
|
|
|
{
|
2022-04-19 16:07:27 +02:00
|
|
|
/**
|
|
|
|
|
* The attributes that should be cast.
|
2019-07-11 11:45:47 +02:00
|
|
|
*
|
2022-04-19 16:07:27 +02:00
|
|
|
* @var array
|
2019-07-11 11:45:47 +02:00
|
|
|
*/
|
2022-04-19 16:07:27 +02:00
|
|
|
protected $casts = [
|
|
|
|
|
'largeur' => 'int',
|
|
|
|
|
'hauteur' => 'int',
|
|
|
|
|
'system' => 'bool',
|
|
|
|
|
];
|
2019-07-11 11:45:47 +02:00
|
|
|
|
2022-06-20 14:57:58 +02:00
|
|
|
// * RELATIONSHIPS
|
|
|
|
|
|
2022-04-19 16:07:27 +02:00
|
|
|
/**
|
2022-06-20 14:57:58 +02:00
|
|
|
* BelongsToMany sujets relation
|
|
|
|
|
*
|
2022-04-19 16:07:27 +02:00
|
|
|
* The sujet that belong to the format.
|
2022-06-20 14:57:58 +02:00
|
|
|
*
|
|
|
|
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
2022-04-19 16:07:27 +02:00
|
|
|
*/
|
|
|
|
|
public function sujets()
|
|
|
|
|
{
|
2022-06-20 14:57:58 +02:00
|
|
|
return $this->belongsToMany(Sujet::class);
|
2019-07-11 11:45:47 +02:00
|
|
|
}
|
|
|
|
|
}
|