39 lines
846 B
PHP
39 lines
846 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class Marque extends Model
|
|
{
|
|
/**
|
|
* The primary key associated with the table.
|
|
*
|
|
* @var string
|
|
*/
|
|
protected $primaryKey = 'codMarq';
|
|
|
|
/**
|
|
* The users that belong to the marque.
|
|
*/
|
|
public function users()
|
|
{
|
|
return $this->belongsToMany('App\Models\User', 'marques_users', 'marque_id', 'user_id');
|
|
}
|
|
|
|
/**
|
|
* The dossier that belong to the marque.
|
|
*/
|
|
public function dossiers()
|
|
{
|
|
return $this->belongsToMany('App\Models\Dossier', 'marques_dossier', 'marque_id', 'dossier_id');
|
|
}
|
|
|
|
/**
|
|
* The medias that belong to the marques.
|
|
*/
|
|
public function medias()
|
|
{
|
|
return $this->belongsToMany('App\Models\Media', 'medias_marques', 'marque_id', 'media_id');
|
|
}
|
|
}
|