move models & view referent

This commit is contained in:
Malibu
2015-02-20 15:00:09 +01:00
parent fe746d6bbb
commit 5fbb41a461
19 changed files with 97 additions and 26 deletions

View File

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