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 App\Scopes\SystemScope;
|
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
|
|
|
|
|
|
class Format extends Model
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* The "booting" method of the model.
|
|
|
|
|
*
|
|
|
|
|
* @return void
|
|
|
|
|
*/
|
|
|
|
|
protected static function boot()
|
|
|
|
|
{
|
|
|
|
|
parent::boot();
|
|
|
|
|
|
2021-02-10 09:09:27 +01:00
|
|
|
//static::addGlobalScope(new SystemScope);
|
2019-07-11 11:45:47 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* The sujet that belong to the format.
|
|
|
|
|
*/
|
|
|
|
|
public function sujets()
|
|
|
|
|
{
|
2019-09-12 11:08:25 +02:00
|
|
|
return $this->belongsToMany('App\Models\Sujet', 'sujets_formats', 'format_id', 'sujet_id');
|
2019-07-11 11:45:47 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|