new main page

This commit is contained in:
alexandre-pereira
2015-03-10 15:57:41 +01:00
parent 853ee062d9
commit df57f8f539
4 changed files with 132 additions and 75 deletions

View File

@ -2,17 +2,6 @@
class HomeController extends Controller {
/*
|--------------------------------------------------------------------------
| Home Controller
|--------------------------------------------------------------------------
|
| This controller renders your application's "dashboard" for users that
| are authenticated. Of course, you are free to change or remove the
| controller as you wish. It is just here to get your app started!
|
*/
/**
* Create a new controller instance.
*
@ -20,7 +9,7 @@ class HomeController extends Controller {
*/
public function __construct()
{
$this->middleware('auth');
//
}
/**
@ -30,9 +19,34 @@ class HomeController extends Controller {
*/
public function index()
{
return view('home');
$res = User::referents()->get();
return view('home',['referents' => $res]);
}
/**
* Show referent games
*
* @param String $id
* @return Response
*/
public function showReferentGames($id)
{
return view('referent_games', ['referent' => $id]);
}
/**
* Show one referent game
*
* @param String $id
* @param String $idGame
* @return Response
*/
public function showOneReferentGame($id, $idGame)
{
return view('one_referent_game', ['referent' => $id, 'game' => $idGame]);
}
}
?>

View File

@ -12,7 +12,13 @@
*/
Route::get('/', 'GameController@index');
Route::get('/', 'HomeController@index');
Route::get('referents/{id}/games', 'GameController@showReferentGames')->where('id', '^((?!login|referent|admin).)*$');
Route::get('referents/{id}/games/{idGame}', 'GameController@showOneReferentGame');