database update

This commit is contained in:
Malibu
2015-02-18 23:15:18 +01:00
parent 2addf1a30b
commit 51fd0b06b9
10 changed files with 143 additions and 45 deletions

27
SRC/app/ListeOeuvre.php Normal file
View File

@ -0,0 +1,27 @@
<?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;
return $query->where('idusers', $idUser);
}
}