Passed
Push — feature/resources ( 26d9e1...959b52 )
by Yonathan
03:18
created
app/Http/Controllers/Api/CommentApiController.php 1 patch
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -21,8 +21,8 @@  discard block
 block discarded – undo
21 21
      */
22 22
     public function indexByJob(JobPoster $jobPoster)
23 23
     {
24
-          $comments = Comment::where('job_poster_id', $jobPoster->id)->get();
25
-          return response()->json(new ResourceCollection($comments));
24
+            $comments = Comment::where('job_poster_id', $jobPoster->id)->get();
25
+            return response()->json(new ResourceCollection($comments));
26 26
     }
27 27
 
28 28
     /**
@@ -34,12 +34,12 @@  discard block
 block discarded – undo
34 34
      */
35 35
     public function store(StoreComment $request, JobPoster $jobPoster)
36 36
     {
37
-          $data = $request->validated();
38
-          $comment = new Comment();
39
-          $comment->user_id = $request->user()->id;
40
-          $comment->job_poster_id = $jobPoster->id;
41
-          $comment->fill($data);
42
-          $comment->save();
43
-          return response()->json(new JsonResource($comment));
37
+            $data = $request->validated();
38
+            $comment = new Comment();
39
+            $comment->user_id = $request->user()->id;
40
+            $comment->job_poster_id = $jobPoster->id;
41
+            $comment->fill($data);
42
+            $comment->save();
43
+            return response()->json(new JsonResource($comment));
44 44
     }
45 45
 }
Please login to merge, or discard this patch.
app/Models/User.php 1 patch
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -264,10 +264,10 @@  discard block
 block discarded – undo
264 264
     }
265 265
 
266 266
     /**
267
-    * Check if the user has the specified role.
268
-    * @param string $role This may be either 'applicant', 'manager', 'hr_advisor' or 'admin'.
269
-    * @return boolean
270
-    */
267
+     * Check if the user has the specified role.
268
+     * @param string $role This may be either 'applicant', 'manager', 'hr_advisor' or 'admin'.
269
+     * @return boolean
270
+     */
271 271
     public function hasRole($role)
272 272
     {
273 273
         switch ($role) {
@@ -288,8 +288,8 @@  discard block
 block discarded – undo
288 288
      * Set this user to the specified role.
289 289
      *
290 290
      * @param string $role Must be either 'applicant', 'manager', 'hr_advisor' or 'admin'.
291
-    * @return void
292
-    */
291
+     * @return void
292
+     */
293 293
     public function setRole(string $role): void
294 294
     {
295 295
         $this->user_role()->associate(UserRole::where('key', $role)->firstOrFail());
Please login to merge, or discard this patch.
app/Http/Controllers/Admin/ResourcesCrudController.php 1 patch
Indentation   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -16,13 +16,13 @@  discard block
 block discarded – undo
16 16
      * Setup for the Resource CRUD panel. Everything here is applied on ALL operations.
17 17
      *
18 18
      * @return void
19
-    */
19
+     */
20 20
     public function setup()
21 21
     {
22
-          $this->crud->setModel('App\Models\Resource');
23
-          $this->crud->setRoute('admin/resource');
24
-          $this->crud->setEntityNameStrings('resource', 'resources');
25
-          $this->crud->removeButton('preview');
22
+            $this->crud->setModel('App\Models\Resource');
23
+            $this->crud->setRoute('admin/resource');
24
+            $this->crud->setEntityNameStrings('resource', 'resources');
25
+            $this->crud->removeButton('preview');
26 26
     }
27 27
 
28 28
     /**
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
             },
53 53
             'searchLogic' => function ($query, $column, $searchTerm) use ($locale) : void {
54 54
                 $query->orWhere('name->' . $locale, 'ilike', "%$searchTerm%");
55
-          },
55
+            },
56 56
         ]);
57 57
     }
58 58
 
@@ -66,22 +66,22 @@  discard block
 block discarded – undo
66 66
         $this->crud->setValidation(ResourceCrudRequest::class);
67 67
 
68 68
         $this->crud->addField([
69
-          'name' => 'name',
70
-          'type' => 'text',
71
-          'label' => 'Title',
69
+            'name' => 'name',
70
+            'type' => 'text',
71
+            'label' => 'Title',
72 72
         ]);
73 73
 
74 74
         $this->crud->addField([
75
-          'name' => 'name',
76
-          'type' => 'text',
77
-          'label' => 'Title'
75
+            'name' => 'name',
76
+            'type' => 'text',
77
+            'label' => 'Title'
78 78
         ]);
79 79
 
80 80
         $this->crud->addField([
81
-          'name' => 'file',
82
-          'label' => 'File',
83
-          'type' => 'upload',
84
-          'upload' => true,
81
+            'name' => 'file',
82
+            'label' => 'File',
83
+            'type' => 'upload',
84
+            'upload' => true,
85 85
         ]);
86 86
     }
87 87
 
@@ -94,4 +94,4 @@  discard block
 block discarded – undo
94 94
     {
95 95
         $this->setupCreateOperation();
96 96
     }
97
-  }
97
+    }
Please login to merge, or discard this patch.
app/Http/Controllers/ResourcesController.php 1 patch
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -25,9 +25,9 @@  discard block
 block discarded – undo
25 25
         $files = Resource::all();
26 26
         foreach ($files as $file) {
27 27
             array_push($resources, [
28
-              'link' => Storage::url($file->file),
29
-              'title' => '',
30
-              'text' => $file->name,
28
+                'link' => Storage::url($file->file),
29
+                'title' => '',
30
+                'text' => $file->name,
31 31
             ]);
32 32
         }
33 33
 
@@ -37,10 +37,10 @@  discard block
 block discarded – undo
37 37
         });
38 38
 
39 39
         return view('common/resources', [
40
-          // Localized strings.
41
-          'resources_template' => $resources_template,
42
-          // List of resource downloads.
43
-          'resources' => $resources,
40
+            // Localized strings.
41
+            'resources_template' => $resources_template,
42
+            // List of resource downloads.
43
+            'resources' => $resources,
44 44
         ]);
45 45
     }
46 46
 }
Please login to merge, or discard this patch.