This repository has been archived on 2021-09-15. You can view files and clone it, but cannot push or open issues or pull requests.
ModuleWeb/SRC/app/Models/ListeOeuvre.php

28 lines
558 B
PHP
Raw Normal View History

2015-02-20 14:00:09 +00:00
<?php namespace App\Models;
2015-02-18 22:15:18 +00:00
use Illuminate\Database\Eloquent\Model;
use Auth;
class ListeOeuvre extends Model {
protected $table = 'listeoeuvre';
public $timestamps = false;
public function oeuvres()
{
2015-02-20 14:00:09 +00:00
return $this->belongsToMany('App\Models\Oeuvre', 'assolisteaoeuvre');
2015-02-18 22:15:18 +00:00
}
public function jeux()
{
2015-02-20 14:00:09 +00:00
return $this->belongsToMany('App\Models\Jeu', 'assolisteajeu');
2015-02-18 22:15:18 +00:00
}
public function scopeCurrentUser($query)
{
$idUser = Auth::user()->id;
return $query->where('iduser', $idUser);
2015-02-18 22:15:18 +00:00
}
}