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