ldc-dam/app/Marque.php

42 lines
768 B
PHP
Raw Normal View History

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
*/
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');
}
/**
* 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
}