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