2019-05-16 17:20:30 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App;
|
|
|
|
|
|
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
|
|
|
|
|
|
class Marque extends Model
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* The primary key associated with the table.
|
|
|
|
|
*
|
|
|
|
|
* @var string
|
|
|
|
|
*/
|
2019-07-11 11:45:47 +02:00
|
|
|
protected $primaryKey = 'codMarq';
|
2019-05-16 17:20:30 +02:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* The users that belong to the marque.
|
|
|
|
|
*/
|
|
|
|
|
public function users()
|
|
|
|
|
{
|
|
|
|
|
return $this->belongsToMany('App\User', 'marques_users', 'marque_id', 'user_id');
|
|
|
|
|
}
|
|
|
|
|
|
2019-05-17 11:35:41 +02:00
|
|
|
/**
|
|
|
|
|
* The dossier that belong to the marque.
|
|
|
|
|
*/
|
|
|
|
|
public function dossiers()
|
|
|
|
|
{
|
|
|
|
|
return $this->belongsToMany('App\Dossier', 'marques_dossier', 'marque_id', 'dossier_id');
|
|
|
|
|
}
|
|
|
|
|
|
2019-06-25 16:17:56 +02:00
|
|
|
/**
|
|
|
|
|
* The medias that belong to the marques.
|
|
|
|
|
*/
|
|
|
|
|
public function medias()
|
|
|
|
|
{
|
|
|
|
|
return $this->belongsToMany('App\Media', 'medias_marques', 'marque_id', 'media_id');
|
|
|
|
|
}
|
|
|
|
|
|
2019-05-16 17:20:30 +02:00
|
|
|
}
|