Skip to content

Commit 3514de5

Browse files
committed
01 - Débuter avec Laravel 6 - Premiers pas avec Eloquent, l'orm de laravel
1 parent 5ca5ba1 commit 3514de5

File tree

9 files changed

+1726
-35
lines changed

9 files changed

+1726
-35
lines changed
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
<?php
2+
3+
namespace App\Http\Controllers;
4+
5+
use App\Todo;
6+
use Illuminate\Http\Request;
7+
8+
class TodoController extends Controller
9+
{
10+
/**
11+
* Display a listing of the resource.
12+
*
13+
* @return \Illuminate\Http\Response
14+
*/
15+
public function index()
16+
{
17+
//
18+
$datas = Todo::all()->reject(function ($todo) {
19+
return $todo->done == 0;
20+
});
21+
22+
return view('todos.index', compact('datas'));
23+
24+
25+
}
26+
27+
/**
28+
* Show the form for creating a new resource.
29+
*
30+
* @return \Illuminate\Http\Response
31+
*/
32+
public function create()
33+
{
34+
//
35+
}
36+
37+
/**
38+
* Store a newly created resource in storage.
39+
*
40+
* @param \Illuminate\Http\Request $request
41+
* @return \Illuminate\Http\Response
42+
*/
43+
public function store(Request $request)
44+
{
45+
//
46+
}
47+
48+
/**
49+
* Display the specified resource.
50+
*
51+
* @param int $id
52+
* @return \Illuminate\Http\Response
53+
*/
54+
public function show($id)
55+
{
56+
//
57+
}
58+
59+
/**
60+
* Show the form for editing the specified resource.
61+
*
62+
* @param int $id
63+
* @return \Illuminate\Http\Response
64+
*/
65+
public function edit($id)
66+
{
67+
//
68+
}
69+
70+
/**
71+
* Update the specified resource in storage.
72+
*
73+
* @param \Illuminate\Http\Request $request
74+
* @param int $id
75+
* @return \Illuminate\Http\Response
76+
*/
77+
public function update(Request $request, $id)
78+
{
79+
//
80+
}
81+
82+
/**
83+
* Remove the specified resource from storage.
84+
*
85+
* @param int $id
86+
* @return \Illuminate\Http\Response
87+
*/
88+
public function destroy($id)
89+
{
90+
//
91+
}
92+
}

app/Providers/AuthServiceProvider.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,5 @@ class AuthServiceProvider extends ServiceProvider
2424
public function boot()
2525
{
2626
$this->registerPolicies();
27-
28-
//
2927
}
3028
}

app/Providers/EventServiceProvider.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,5 @@ public function boot()
2929
{
3030
parent::boot();
3131

32-
//
3332
}
3433
}

app/Providers/RouteServiceProvider.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ public function map()
4646

4747
$this->mapWebRoutes();
4848

49-
//
5049
}
5150

5251
/**

app/User.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,7 @@ class User extends Authenticatable
1010
{
1111
use Notifiable;
1212

13-
/**
14-
* The attributes that are mass assignable.
15-
*
16-
* @var array
17-
*/
13+
/** @var array $fillable The attributes that are mass assignable */
1814
protected $fillable = [
1915
'name', 'email', 'password',
2016
];

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"laravel/dusk": "^5.9",
2222
"mockery/mockery": "^1.0",
2323
"nunomaduro/collision": "^3.0",
24+
"nunomaduro/phpinsights": "^1.14",
2425
"phpunit/phpunit": "^8.0"
2526
},
2627
"config": {

0 commit comments

Comments
 (0)