Skip to content

Commit

Permalink
ajout d'un model de User basique
Browse files Browse the repository at this point in the history
  • Loading branch information
hyptos committed Apr 28, 2015
1 parent 93abfa3 commit 8a6e62a
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 63 deletions.
37 changes: 0 additions & 37 deletions service/.env.example

This file was deleted.

10 changes: 7 additions & 3 deletions service/app/Http/Controllers/UserController.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<?php namespace App\Http\Controllers;
<?php

namespace App\Http\Controllers;

use App\User;
use App\Http\Controllers\Controller;
use App\Models\User;

class UserController extends Controller {

Expand All @@ -13,7 +15,9 @@ class UserController extends Controller {
*/
public function showProfile($id)
{
return view('user', ['user' => $id]);

$users = User::all();
return view('user', ['user' => $id, 'users' => $users]);
}

}
18 changes: 18 additions & 0 deletions service/app/Models/User.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

namespace App\Models;
use Illuminate\Database\Eloquent\Model;

class User extends Model {
protected $table = 'Users';
public $timestamps = false;
protected $fillable = [
'name',
'username',
'email',
'password'
];
protected $hidden = [ 'password' ];
}


6 changes: 3 additions & 3 deletions service/bootstrap/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

require_once __DIR__.'/../vendor/autoload.php';

// Dotenv::load(__DIR__.'/../');
Dotenv::load(__DIR__.'/../');

/*
|--------------------------------------------------------------------------
Expand All @@ -17,9 +17,9 @@

$app = new Laravel\Lumen\Application;

// $app->withFacades();
$app->withFacades();

// $app->withEloquent();
$app->withEloquent();

/*
|--------------------------------------------------------------------------
Expand Down
20 changes: 0 additions & 20 deletions service/database/seeds/DatabaseSeeder.php

This file was deleted.

1 change: 1 addition & 0 deletions service/resources/views/user.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@

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

0 comments on commit 8a6e62a

Please sign in to comment.