Completed
Push — master ( 367e07...23dc00 )
by richard
15:03
created
app/Providers/AuthServiceProvider.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@
 block discarded – undo
30 30
         // should return either a User instance or null. You're free to obtain
31 31
         // the User instance via an API token or any other method necessary.
32 32
 
33
-        $this->app['auth']->viaRequest('api', function ($request) {
33
+        $this->app[ 'auth' ]->viaRequest('api', function($request) {
34 34
             if ($request->input('api_token')) {
35 35
                 return User::where('api_token', $request->input('api_token'))->first();
36 36
             }
Please login to merge, or discard this patch.
database/migrations/2018_02_11_113322_create_authors_table.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
      */
14 14
     public function up()
15 15
     {
16
-        Schema::create('authors', function (Blueprint $table) {
16
+        Schema::create('authors', function(Blueprint $table) {
17 17
             $table->increments('id');
18 18
             $table->string('first_name');
19 19
             $table->string('last_name');
Please login to merge, or discard this patch.
database/migrations/2018_03_16_080732_create_images_table.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
      */
14 14
     public function up()
15 15
     {
16
-        Schema::create('images', function (Blueprint $table) {
16
+        Schema::create('images', function(Blueprint $table) {
17 17
             $table->increments('id');
18 18
             $table->integer('post_id')->unsigned();
19 19
             $table->string('url');
Please login to merge, or discard this patch.
database/migrations/2018_02_11_112643_create_posts_table.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
      */
14 14
     public function up()
15 15
     {
16
-        Schema::create('posts', function (Blueprint $table) {
16
+        Schema::create('posts', function(Blueprint $table) {
17 17
             $table->increments('id');
18 18
             $table->integer('author_id')->unsigned();
19 19
             $table->string('title');
Please login to merge, or discard this patch.
database/factories/ModelFactory.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
 |
12 12
 */
13 13
 
14
-$factory->define(App\User::class, function (Faker\Generator $faker) {
14
+$factory->define(App\User::class, function(Faker\Generator $faker) {
15 15
     return [
16 16
         'name' => $faker->name,
17 17
         'email' => $faker->email,
Please login to merge, or discard this patch.
app/Http/Controllers/Api/V1/PostsController.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
     public function index()
26 26
     {
27 27
         $posts = Redis::get('posts');
28
-        if (! $posts) {
28
+        if (!$posts) {
29 29
             $posts = Post::with('author')->get();
30 30
         }
31 31
 
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
     public function show($id)
48 48
     {
49 49
         $post = Redis::get('posts:'.$id);
50
-        if (! $post) {
50
+        if (!$post) {
51 51
             $post = Post::with('author')->findOrFail($id);
52 52
         }
53 53
 
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
     public function author($id)
98 98
     {
99 99
         $author = Redis::get('posts:authors:'.$id);
100
-        if (! $author) {
100
+        if (!$author) {
101 101
             $author = Post::findOrFail($id)->author;
102 102
         }
103 103
 
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
     public function images($id)
115 115
     {
116 116
         $images = Redis::get('posts:images:'.$id);
117
-        if (! $images) {
117
+        if (!$images) {
118 118
             $images = Post::findOrFail($id)->images;
119 119
         }
120 120
 
Please login to merge, or discard this patch.
app/Http/Controllers/Api/V1/BaseController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@
 block discarded – undo
47 47
     {
48 48
         $parts = explode('\\', $this->model);
49 49
 
50
-        return strtolower($parts[sizeof($parts)-1]);
50
+        return strtolower($parts[ sizeof($parts) - 1 ]);
51 51
     }
52 52
 
53 53
     /**
Please login to merge, or discard this patch.
migrations/2018_04_07_235921_add_filename_column_to_images_table.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
      */
14 14
     public function up()
15 15
     {
16
-        Schema::table('images', function (Blueprint $table) {
16
+        Schema::table('images', function(Blueprint $table) {
17 17
             $table->string('filename');
18 18
         });
19 19
     }
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
      */
26 26
     public function down()
27 27
     {
28
-        Schema::table('images', function (Blueprint $table) {
28
+        Schema::table('images', function(Blueprint $table) {
29 29
             $table->dropColumnIfExists('filename');
30 30
         });
31 31
     }
Please login to merge, or discard this patch.
app/Http/Controllers/Api/V1/ImagesController.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -70,23 +70,23 @@
 block discarded – undo
70 70
             );
71 71
         }
72 72
 
73
-        if (! $this->requests->hasFile('file')) {
73
+        if (!$this->requests->hasFile('file')) {
74 74
             return $this->response->array([
75 75
                 'status' => 'error',
76 76
                 'message' => 'Invalid request',
77
-                'errors' => ['Invalid file.',],
77
+                'errors' => [ 'Invalid file.', ],
78 78
             ]);
79 79
         }
80 80
 
81
-        if (! $this->requests->file('file')->isValid()) {
81
+        if (!$this->requests->file('file')->isValid()) {
82 82
             return $this->response->array([
83 83
                 'status' => 'error',
84 84
                 'message' => 'Invalid request',
85
-                'errors' => ['Invalid file upload.',],
85
+                'errors' => [ 'Invalid file upload.', ],
86 86
             ]);
87 87
         }
88 88
 
89
-        $slug = uniqid().'_'.str_slug(explode('.', $this->requests->file->getClientOriginalName())[0]);
89
+        $slug = uniqid().'_'.str_slug(explode('.', $this->requests->file->getClientOriginalName())[ 0 ]);
90 90
         $filename = $slug.'.'.$this->requests->file->extension();
91 91
 
92 92
         // move image
Please login to merge, or discard this patch.