Completed
Push — master ( 5da3c5...1ddebf )
by Manu
50:21 queued 35:23
created
src/Http/Controllers/PostController.php 2 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -8,10 +8,10 @@  discard block
 block discarded – undo
8 8
 
9 9
 class PostController extends Controller {
10 10
 
11
-  /**
12
-   * Saves a new post to the database
13
-   */
14
-  public function store(Request $request) {
11
+    /**
12
+     * Saves a new post to the database
13
+     */
14
+    public function store(Request $request) {
15 15
     // ...
16 16
     // validation can be done here before saving
17 17
     // with $this->validate($request, $rules)
@@ -30,5 +30,5 @@  discard block
 block discarded – undo
30 30
 
31 31
     // return post as response, Laravel automatically serializes this to JSON
32 32
     return response($post, 201);
33
-  }
33
+    }
34 34
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@
 block discarded – undo
18 18
     // ...
19 19
 
20 20
     // get data to save in an associative array using $request->only()
21
-    $data = $request->only(['title', 'description']);
21
+    $data = $request->only([ 'title', 'description' ]);
22 22
 
23 23
     //  save post and assign return value of created post to $post array
24 24
     $post = Post::create($data);
Please login to merge, or discard this patch.