ldc-dam/app/Sujet.php
2019-05-17 11:35:41 +02:00

33 lines
555 B
PHP

<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Sujet extends Model
{
/**
* The primary key associated with the table.
*
* @var string
*/
protected $primaryKey = 'CODE_SUJET';
/**
* The users that belong to the sujet.
*/
public function users()
{
return $this->belongsToMany('App\User', 'sujets_users', 'sujet_id', 'user_id');
}
/**
* Get the dossier for the sujet.
*/
public function dossiers()
{
return $this->hasMany('App\Dossier');
}
}