Completed
Push — master ( ca1d14...32632b )
by Julien
03:18
created
app/Http/routes.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -27,13 +27,13 @@  discard block
 block discarded – undo
27 27
 /**
28 28
  * BackOffice
29 29
  */
30
-Route::group(['prefix' => 'admin', 'middleware' => 'auth'], function () {
30
+Route::group([ 'prefix' => 'admin', 'middleware' => 'auth' ], function() {
31 31
 
32 32
 
33 33
     /**
34 34
      * Cart Payment
35 35
      */
36
-    Route::group(['prefix' => 'cart'], function () {
36
+    Route::group([ 'prefix' => 'cart' ], function() {
37 37
         /**
38 38
          * Pages Recapitulatif
39 39
          */
@@ -89,9 +89,9 @@  discard block
 block discarded – undo
89 89
     /**
90 90
      * COMMENTAIRES
91 91
      */
92
-    Route::group(['prefix' => 'comments'], function () {
93
-        Route::get('/index', ['uses' => 'CommentsController@index','as' => 'comments.index']);
94
-        Route::post('{id}/update', ['uses' => 'CommentsController@update','as' => 'comments.update']);
92
+    Route::group([ 'prefix' => 'comments' ], function() {
93
+        Route::get('/index', [ 'uses' => 'CommentsController@index', 'as' => 'comments.index' ]);
94
+        Route::post('{id}/update', [ 'uses' => 'CommentsController@update', 'as' => 'comments.update' ]);
95 95
 
96 96
         /**
97 97
          * Action Like
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
     /**
108 108
      * CRUD de Movies
109 109
      */
110
-    Route::group(['prefix' => 'movies'], function () {
110
+    Route::group([ 'prefix' => 'movies' ], function() {
111 111
 
112 112
         /**
113 113
          * Page index: liste des films
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
 
194 194
 
195 195
 // CRUD de categories
196
-    Route::group(['prefix' => 'categories'], function () {
196
+    Route::group([ 'prefix' => 'categories' ], function() {
197 197
 
198 198
         Route::get('/index', [
199 199
             'as' => 'categories_index',
@@ -244,7 +244,7 @@  discard block
 block discarded – undo
244 244
 
245 245
 
246 246
 // CRUD de actors
247
-    Route::group(['prefix' => 'actors'], function () {
247
+    Route::group([ 'prefix' => 'actors' ], function() {
248 248
 
249 249
         Route::get('/index', [
250 250
             'as' => 'actors_index',
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
 
273 273
 
274 274
 // CRUD de directors
275
-    Route::group(['prefix' => 'directors'], function () {
275
+    Route::group([ 'prefix' => 'directors' ], function() {
276 276
 
277 277
         Route::get('/index', [
278 278
             'as' => 'directors_delete',
@@ -300,7 +300,7 @@  discard block
 block discarded – undo
300 300
 
301 301
 
302 302
 
303
-    Route::group(['prefix' => "api"], function () {
303
+    Route::group([ 'prefix' => "api" ], function() {
304 304
 
305 305
         // mon retour en JSON de mes catégories
306 306
         Route::get('/categories', [
@@ -320,7 +320,7 @@  discard block
 block discarded – undo
320 320
 
321 321
 
322 322
     // CRUD de administrators
323
-    Route::group(['prefix' => "administrators",    "middleware" => "authorisation"], function () {
323
+    Route::group([ 'prefix' => "administrators", "middleware" => "authorisation" ], function() {
324 324
 
325 325
         Route::get('/index', [
326 326
             'as' => 'administrators_index',
@@ -378,7 +378,7 @@  discard block
 block discarded – undo
378 378
 /**
379 379
  * Page FAQ
380 380
  */
381
-Route::get('/faq', function () {
381
+Route::get('/faq', function() {
382 382
 
383 383
     return view('Pages/faq');
384 384
 });
@@ -387,7 +387,7 @@  discard block
 block discarded – undo
387 387
 /**
388 388
  * Page about
389 389
  */
390
-Route::get('/about', function () {
390
+Route::get('/about', function() {
391 391
 
392 392
     // retourne le nom de la vue
393 393
     return view('Pages/about');
@@ -397,7 +397,7 @@  discard block
 block discarded – undo
397 397
 /**
398 398
  * Pages concept
399 399
  */
400
-Route::get('/concept', function () {
400
+Route::get('/concept', function() {
401 401
 
402 402
     // retourne le nom de la vue
403 403
     return view('Pages/concept');
Please login to merge, or discard this patch.
app/Console/Commands/LastMovies.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -42,17 +42,17 @@
 block discarded – undo
42 42
     {
43 43
 
44 44
         // SQL query
45
-        $results = Movies::where('date_release','>=', new Carbon('-1 month'))
46
-                        ->where('date_release','<=', new Carbon('now'))
45
+        $results = Movies::where('date_release', '>=', new Carbon('-1 month'))
46
+                        ->where('date_release', '<=', new Carbon('now'))
47 47
                         ->get();
48 48
 
49 49
         // je parcours mes films
50
-        foreach($results as $movie){
50
+        foreach ($results as $movie) {
51 51
 
52 52
             $users = $movie->actors();
53
-            foreach($users as $user){
53
+            foreach ($users as $user) {
54 54
                 //send an email
55
-                Mail::send('Emails/newsletter', [], function ($m) {
55
+                Mail::send('Emails/newsletter', [ ], function($m) {
56 56
 
57 57
                     $m->from('[email protected]', 'Florent Boyer');
58 58
                     $m->to("[email protected]", "Boyer Julien")
Please login to merge, or discard this patch.
app/Http/Controllers/AdministratorsController.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -12,15 +12,15 @@  discard block
 block discarded – undo
12 12
 /**
13 13
  * Class AdministratorsController
14 14
  */
15
-class AdministratorsController extends Controller{
15
+class AdministratorsController extends Controller {
16 16
 
17 17
     /**
18 18
      * Page de liste des administrateurs
19 19
      */
20
-    public function index(){
20
+    public function index() {
21 21
         $administrators = Administrators::all();
22 22
 
23
-        return view('Administrators/index',[
23
+        return view('Administrators/index', [
24 24
             'administrators' => $administrators
25 25
         ]);
26 26
     }
@@ -31,12 +31,12 @@  discard block
 block discarded – undo
31 31
      * @param $id
32 32
      * @return mixed
33 33
      */
34
-    public function remove($id){
34
+    public function remove($id) {
35 35
 
36 36
         // To load an administrator
37 37
         $administrator = Administrators::find($id);
38 38
 
39
-        if($administrator){
39
+        if ($administrator) {
40 40
             Session::flash('success', "L'administrateur {$administrator->email} a bien été supprimé");
41 41
             $administrator->delete();
42 42
         }
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
      * @param $id
52 52
      * @return mixed
53 53
      */
54
-    public function create(){
54
+    public function create() {
55 55
 
56 56
         return view('Administrators/create');
57 57
     }
@@ -59,12 +59,12 @@  discard block
 block discarded – undo
59 59
      * To store an administrators
60 60
      * ARgument $id est facultatif: null est sa valeur par défaut
61 61
      */
62
-    public function store(AdministratorsRequest $request, $id = null){
62
+    public function store(AdministratorsRequest $request, $id = null) {
63 63
 
64 64
         // creation: créer un nouvel administrateur
65
-        if($id === null){
65
+        if ($id === null) {
66 66
             $administrator = new Administrators();
67
-        }else{
67
+        } else {
68 68
             // edition: récupérer un administrateur
69 69
             $administrator = Administrators::find($id);
70 70
         }
@@ -76,22 +76,22 @@  discard block
 block discarded – undo
76 76
 
77 77
         // si l'utilisateur modifie
78 78
         // son mot de passe en mode edition
79
-        if(!empty($request->password)){
79
+        if (!empty($request->password)) {
80 80
             $administrator->password = bcrypt($request->password); //if en mode edit
81 81
         }
82 82
 
83
-        $administrator->super_admin =  $request->super_admin;
83
+        $administrator->super_admin = $request->super_admin;
84 84
         $administrator->expiration_date = new \DateTime('+1 year');
85 85
         $administrator->active = true;
86 86
 
87 87
         //upload
88 88
         $filename = "";
89
-        if($request->hasFile('image')) {
89
+        if ($request->hasFile('image')) {
90 90
             $file = $request->file('image');
91 91
             $filename = $file->getClientOriginalName(); // Récupère le nom original du fichier
92
-            $destinationPath = public_path() . '/uploads/administrators'; // Indique où stocker le fichier
92
+            $destinationPath = public_path().'/uploads/administrators'; // Indique où stocker le fichier
93 93
             $file->move($destinationPath, $filename); // Déplace le fichier
94
-            $administrator->photo = asset("uploads/administrators/". $filename);
94
+            $administrator->photo = asset("uploads/administrators/".$filename);
95 95
         }
96 96
 
97 97
         $administrator->save();
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
      * @param $id
111 111
      * @return mixed
112 112
      */
113
-    public function edit($id){
113
+    public function edit($id) {
114 114
 
115 115
         $administrator = Administrators::find($id);
116 116
 
Please login to merge, or discard this patch.
app/Http/Requests/AdministratorsRequest.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
         $id = $this->route('id');
29 29
 
30 30
         // Création d'administrateur
31
-        if($id === null) {
31
+        if ($id === null) {
32 32
             return [
33 33
                 'firstname' => 'required|max:255',
34 34
                 'lastname' => 'required|max:255',
@@ -39,12 +39,12 @@  discard block
 block discarded – undo
39 39
             ];
40 40
         }
41 41
         // Edition administrateur
42
-        else{
42
+        else {
43 43
             return [
44 44
                 'firstname' => 'required|max:255',
45 45
                 'lastname' => 'required|max:255',
46 46
                 'description' => 'required|min:10',
47
-                'email' => 'required|email|max:255|unique:administrators,email,' . $id,
47
+                'email' => 'required|email|max:255|unique:administrators,email,'.$id,
48 48
                 'password' => 'confirmed|min:6',
49 49
                 'image' => 'image',
50 50
             ];
Please login to merge, or discard this patch.
app/Policies/SuperAdminPolicy.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -20,9 +20,9 @@  discard block
 block discarded – undo
20 20
      */
21 21
     public function isSuperAdmin(Administrators $administrator)
22 22
     {
23
-        if($administrator->super_admin === true){
23
+        if ($administrator->super_admin === true) {
24 24
             return true;
25
-        }else{
25
+        } else {
26 26
             return false;
27 27
         }
28 28
     }
@@ -36,9 +36,9 @@  discard block
 block discarded – undo
36 36
     {
37 37
 
38 38
         // si j'ai expiration au niveau des date d'expiratio n
39
-        if($administrator->expiration_date > date('Y-m-d')){
39
+        if ($administrator->expiration_date > date('Y-m-d')) {
40 40
             return true;
41
-        }else{
41
+        } else {
42 42
             return false;
43 43
         }
44 44
     }
Please login to merge, or discard this patch.