ldc-dam/app/Models/Format.php
Vincent BRIDIER 0056111538 - Déplacement des models dans un dossier
- Fix vider la barre de recherche quand on clique sur "Réinitialiser"
- Fix script index ElasticMedia + ajout condition sur l'existence d'un index
- Ajout de la requete Elasticsearch dans MediaController
2019-09-12 11:08:25 +02:00

31 lines
515 B
PHP

<?php
namespace App\Models;
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();
static::addGlobalScope(new SystemScope);
}
/**
* The sujet that belong to the format.
*/
public function sujets()
{
return $this->belongsToMany('App\Models\Sujet', 'sujets_formats', 'format_id', 'sujet_id');
}
}