@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | * de ma table movies |
| 12 | 12 | * Hérite de ma super classe Model |
| 13 | 13 | */ |
| 14 | -class Movies extends Model{ |
|
| 14 | +class Movies extends Model { |
|
| 15 | 15 | |
| 16 | 16 | |
| 17 | 17 | /** |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | /** |
| 26 | 26 | * Retourne tous les films |
| 27 | 27 | */ |
| 28 | - public function getAllMovies(){ |
|
| 28 | + public function getAllMovies() { |
|
| 29 | 29 | |
| 30 | 30 | // retourne le resultat de ma requete SELECT * FROM movies |
| 31 | 31 | return DB::table('movies')->get(); |
@@ -70,7 +70,7 @@ |
||
| 70 | 70 | /** |
| 71 | 71 | * Pour la suppression, il n'y a pas de vue dédiée. |
| 72 | 72 | * On redirige donc vers l'index. |
| 73 | - * @return \Illuminate\View\View |
|
| 73 | + * @return \Illuminate\Http\RedirectResponse |
|
| 74 | 74 | */ |
| 75 | 75 | public function delete($id) |
| 76 | 76 | { |
@@ -28,8 +28,8 @@ discard block |
||
| 28 | 28 | 'comments' => Comments::all() |
| 29 | 29 | ]; |
| 30 | 30 | |
| 31 | - $comment= new Comments(); |
|
| 32 | - $datas['bestCommenter'] = $comment->bestCommenter(); |
|
| 31 | + $comment = new Comments(); |
|
| 32 | + $datas[ 'bestCommenter' ] = $comment->bestCommenter(); |
|
| 33 | 33 | |
| 34 | 34 | return view('Comments/index', $datas); |
| 35 | 35 | } |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | */ |
| 48 | 48 | public function read($id) |
| 49 | 49 | { |
| 50 | - return view('Comments/read', ['id' => $id]); |
|
| 50 | + return view('Comments/read', [ 'id' => $id ]); |
|
| 51 | 51 | |
| 52 | 52 | } |
| 53 | 53 | |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | $value = $request->value; |
| 63 | 63 | |
| 64 | 64 | $comment = Comments::find($id); |
| 65 | - $comment->update([$field => $value]); |
|
| 65 | + $comment->update([ $field => $value ]); |
|
| 66 | 66 | // Session::flash('success', "Le commentaire a bien été mis à jour"); |
| 67 | 67 | // return Redirect::route('comments.index'); |
| 68 | 68 | } |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | */ |
| 75 | 75 | public function delete($id) |
| 76 | 76 | { |
| 77 | - return redirect('/comments', ['id' => $id]); |
|
| 77 | + return redirect('/comments', [ 'id' => $id ]); |
|
| 78 | 78 | |
| 79 | 79 | } |
| 80 | 80 | |
@@ -88,12 +88,12 @@ discard block |
||
| 88 | 88 | $id = $request->input('id'); |
| 89 | 89 | $action = $request->input('action'); |
| 90 | 90 | // Récupération en session de l'item "favoris" |
| 91 | - $liked = session("commentsFavoris", []); |
|
| 91 | + $liked = session("commentsFavoris", [ ]); |
|
| 92 | 92 | |
| 93 | 93 | if ($action == "add") { |
| 94 | 94 | |
| 95 | 95 | // Enregistrement en variable de l'id souhaité |
| 96 | - $liked[] = $id; |
|
| 96 | + $liked[ ] = $id; |
|
| 97 | 97 | // Stockage de cette variable de la session |
| 98 | 98 | Session::put("commentsFavoris", $liked); |
| 99 | 99 | |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | // On cherche la position de l'id dans le tableau |
| 104 | 104 | $position = array_search($id, $liked); |
| 105 | 105 | // On supprime l'élément grâce à sa position |
| 106 | - unset($liked[$position]); |
|
| 106 | + unset($liked[ $position ]); |
|
| 107 | 107 | |
| 108 | 108 | // Stockage de cette variable de la session |
| 109 | 109 | Session::put("commentsFavoris", $liked); |
@@ -9,12 +9,12 @@ discard block |
||
| 9 | 9 | * Sufficé par le mot clef Controller |
| 10 | 10 | * et doit hérité de la super classe Controller |
| 11 | 11 | */ |
| 12 | -class MainController extends Controller{ |
|
| 12 | +class MainController extends Controller { |
|
| 13 | 13 | |
| 14 | 14 | /** |
| 15 | 15 | * Page Acceuil |
| 16 | 16 | */ |
| 17 | - public function index(){ |
|
| 17 | + public function index() { |
|
| 18 | 18 | |
| 19 | 19 | return view('Main/index'); |
| 20 | 20 | } |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | /** |
| 24 | 24 | * Page Acceuil |
| 25 | 25 | */ |
| 26 | - public function dashboard(){ |
|
| 26 | + public function dashboard() { |
|
| 27 | 27 | |
| 28 | 28 | return view('Main/dashboard'); |
| 29 | 29 | } |
@@ -32,19 +32,19 @@ |
||
| 32 | 32 | * |
| 33 | 33 | * @var array |
| 34 | 34 | */ |
| 35 | - protected $fillable = ['name', 'email', 'password']; |
|
| 35 | + protected $fillable = [ 'name', 'email', 'password' ]; |
|
| 36 | 36 | |
| 37 | 37 | /** |
| 38 | 38 | * The attributes excluded from the model's JSON form. |
| 39 | 39 | * |
| 40 | 40 | * @var array |
| 41 | 41 | */ |
| 42 | - protected $hidden = ['password', 'remember_token']; |
|
| 42 | + protected $hidden = [ 'password', 'remember_token' ]; |
|
| 43 | 43 | |
| 44 | 44 | |
| 45 | 45 | |
| 46 | - public function getFullname(){ |
|
| 47 | - return ucfirst($this->firstname)." ". ucfirst($this->lastname); |
|
| 46 | + public function getFullname() { |
|
| 47 | + return ucfirst($this->firstname)." ".ucfirst($this->lastname); |
|
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | |
@@ -11,7 +11,7 @@ |
||
| 11 | 11 | * de ma table movies |
| 12 | 12 | * Hérite de ma super classe Model |
| 13 | 13 | */ |
| 14 | -class Comments extends Model{ |
|
| 14 | +class Comments extends Model { |
|
| 15 | 15 | |
| 16 | 16 | /** |
| 17 | 17 | * Décrit le nom de la table |
@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | * de ma table movies |
| 12 | 12 | * Hérite de ma super classe Model |
| 13 | 13 | */ |
| 14 | -class Users extends Model{ |
|
| 14 | +class Users extends Model { |
|
| 15 | 15 | |
| 16 | 16 | |
| 17 | 17 | /** |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | /** |
| 26 | 26 | * Retourne tous les films |
| 27 | 27 | */ |
| 28 | - public function getAllMovies(){ |
|
| 28 | + public function getAllMovies() { |
|
| 29 | 29 | |
| 30 | 30 | // retourne le resultat de ma requete SELECT * FROM movies |
| 31 | 31 | return DB::table('users')->get(); |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | /** |
| 26 | 26 | * BackOffice |
| 27 | 27 | */ |
| 28 | -Route::group(['prefix' => 'admin', 'middleware' => 'auth'], function () { |
|
| 28 | +Route::group([ 'prefix' => 'admin', 'middleware' => 'auth' ], function() { |
|
| 29 | 29 | |
| 30 | 30 | |
| 31 | 31 | |
@@ -42,9 +42,9 @@ discard block |
||
| 42 | 42 | /** |
| 43 | 43 | * COMMENTAIRES |
| 44 | 44 | */ |
| 45 | - Route::group(['prefix' => 'comments'], function () { |
|
| 46 | - Route::get('/index', ['uses' => 'CommentsController@index','as' => 'comments.index']); |
|
| 47 | - Route::post('{id}/update', ['uses' => 'CommentsController@update','as' => 'comments.update']); |
|
| 45 | + Route::group([ 'prefix' => 'comments' ], function() { |
|
| 46 | + Route::get('/index', [ 'uses' => 'CommentsController@index', 'as' => 'comments.index' ]); |
|
| 47 | + Route::post('{id}/update', [ 'uses' => 'CommentsController@update', 'as' => 'comments.update' ]); |
|
| 48 | 48 | |
| 49 | 49 | }); |
| 50 | 50 | |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | /** |
| 53 | 53 | * CRUD de Movies |
| 54 | 54 | */ |
| 55 | - Route::group(['prefix' => 'movies'], function () { |
|
| 55 | + Route::group([ 'prefix' => 'movies' ], function() { |
|
| 56 | 56 | |
| 57 | 57 | /** |
| 58 | 58 | * Page index: liste des films |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | |
| 133 | 133 | |
| 134 | 134 | // CRUD de categories |
| 135 | - Route::group(['prefix' => 'categories'], function () { |
|
| 135 | + Route::group([ 'prefix' => 'categories' ], function() { |
|
| 136 | 136 | |
| 137 | 137 | Route::get('/index', [ |
| 138 | 138 | 'as' => 'categories_index', |
@@ -183,7 +183,7 @@ discard block |
||
| 183 | 183 | |
| 184 | 184 | |
| 185 | 185 | // CRUD de actors |
| 186 | - Route::group(['prefix' => 'actors'], function () { |
|
| 186 | + Route::group([ 'prefix' => 'actors' ], function() { |
|
| 187 | 187 | |
| 188 | 188 | Route::get('/index', [ |
| 189 | 189 | 'as' => 'actors_index', |
@@ -211,7 +211,7 @@ discard block |
||
| 211 | 211 | |
| 212 | 212 | |
| 213 | 213 | // CRUD de directors |
| 214 | - Route::group(['prefix' => 'directors'], function () { |
|
| 214 | + Route::group([ 'prefix' => 'directors' ], function() { |
|
| 215 | 215 | |
| 216 | 216 | Route::get('/index', [ |
| 217 | 217 | 'as' => 'directors_delete', |
@@ -256,7 +256,7 @@ discard block |
||
| 256 | 256 | /** |
| 257 | 257 | * Page FAQ |
| 258 | 258 | */ |
| 259 | -Route::get('/faq', function () { |
|
| 259 | +Route::get('/faq', function() { |
|
| 260 | 260 | |
| 261 | 261 | return view('Pages/faq'); |
| 262 | 262 | }); |
@@ -265,7 +265,7 @@ discard block |
||
| 265 | 265 | /** |
| 266 | 266 | * Page about |
| 267 | 267 | */ |
| 268 | -Route::get('/about', function () { |
|
| 268 | +Route::get('/about', function() { |
|
| 269 | 269 | |
| 270 | 270 | // retourne le nom de la vue |
| 271 | 271 | return view('Pages/about'); |
@@ -275,7 +275,7 @@ discard block |
||
| 275 | 275 | /** |
| 276 | 276 | * Pages concept |
| 277 | 277 | */ |
| 278 | -Route::get('/concept', function () { |
|
| 278 | +Route::get('/concept', function() { |
|
| 279 | 279 | |
| 280 | 280 | // retourne le nom de la vue |
| 281 | 281 | return view('Pages/concept'); |