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
Executable File

<?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);
}
}