Skip to content

Commit

Permalink
ajout de allUsers
Browse files Browse the repository at this point in the history
  • Loading branch information
hyptos committed Apr 28, 2015
1 parent 8a6e62a commit 1f16d97
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 13 deletions.
7 changes: 6 additions & 1 deletion service/app/Http/Controllers/UserController.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,14 @@ class UserController extends Controller {
*/
public function showProfile($id)
{
$user = User::find($id);
return view('user', ['user' => $user]);
}

public function getAllProfile()
{
$users = User::all();
return view('user', ['user' => $id, 'users' => $users]);
return view('userAll', ['users' => $users]);
}

}
5 changes: 1 addition & 4 deletions service/app/Http/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,5 @@
return 'user';
});

$app->get('user/{id}', function($id){
return 'user'+$id;
});

$app->get('user/{id}', 'App\Http\Controllers\UserController@showProfile');
$app->get('users', 'App\Http\Controllers\UserController@getAllProfile');
9 changes: 1 addition & 8 deletions service/resources/views/user.blade.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
@extends('layouts.master')

@section('title', 'Page Title')

@section('sidebar')
@parent

<p>This is appended to the master sidebar.</p>
@stop
@section('title', 'User')

@section('content')
<p>{{$user}}</p>
<p>{{$users}}</p>
@stop
7 changes: 7 additions & 0 deletions service/resources/views/userAll.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
@extends('layouts.master')

@section('title', 'All Users')

@section('content')
<p>{{$users}}</p>
@stop

0 comments on commit 1f16d97

Please sign in to comment.