modifié : SRC/app/Http/Controllers/ReferentController.php

modifié :         SRC/app/Http/routes.php
	modifié :         SRC/public/js/getListeOeuvre.js
This commit is contained in:
sidya82
2015-02-19 17:35:57 +01:00
parent d92ce6372d
commit 2a18c47789
3 changed files with 10 additions and 7 deletions

View File

@ -31,8 +31,8 @@ class ReferentController extends Controller {
$me = User::current();
$user = User::all();
// $ListeOeuvre = ListeOeuvre::find(1);
// $ListeOeuvre->oeuvres()->attach([22, 23, 24, 25, 26]);
//$ListeOeuvre = ListeOeuvre::find(2);
//$ListeOeuvre->oeuvres()->attach([22, 23, 24, 25, 26]);
$listeoeuvres = ListeOeuvre::currentUser()->get();
return view('referent', ['nameRoute' => 'Référent', 'me' => $me, 'listeoeuvres' => $listeoeuvres]);
@ -83,7 +83,7 @@ class ReferentController extends Controller {
public function showListeOeuvres($id)
{
return Response::json(ListeOeuvre::currentUser()->get()[0]->oeuvres->toArray());
return Response::json(ListeOeuvre::currentUser()->get()[1]->oeuvres->toArray());
}
public function deleteListeOeuvre()

View File

@ -39,6 +39,7 @@ Route::group(['middleware' => 'auth'], function ()
Route::post('deleteListeOeuvre', 'ReferentController@deleteListeOeuvre');
Route::post('addListeOeuvre', 'ReferentController@addListeOeuvre');
Route::get('showListOeuvres/{id}', 'ReferentController@showListeOeuvres');
Route::get('setListOeuvres', 'ReferentController@setListOeuvres');
});
Route::group(['middleware' => 'admin'], function ()