Completed
Push — master ( 9ea2f2...b3b4f1 )
by David
10:08 queued 04:07
created
src/AbstractModel.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@
 block discarded – undo
22 22
      */
23 23
     public function getCount()
24 24
     {
25
-        $count = \DB::select('select COUNT(*) as `count` from ' . $this->table);
26
-        return $count[0]->count;
25
+        $count = \DB::select('select COUNT(*) as `count` from '.$this->table);
26
+        return $count[ 0 ]->count;
27 27
     }
28 28
 }
Please login to merge, or discard this patch.
src/Database/Migrator.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
     public function migrateCategories()
20 20
     {
21 21
         if (!Schema::hasTable('forum_categories')) {
22
-            Schema::create('forum_categories', function ($table) {
22
+            Schema::create('forum_categories', function($table) {
23 23
                 $table->increments('id');
24 24
                 $table->string('name');
25 25
                 $table->timestamps();
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
     public function migrateForums()
34 34
     {
35 35
         if (!Schema::hasTable('forums')) {
36
-            Schema::create('forums', function ($table) {
36
+            Schema::create('forums', function($table) {
37 37
                 $table->increments('id');
38 38
                 $table->string('name');
39 39
                 $table->string('description')->nullable();
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
     public function migratePosts()
51 51
     {
52 52
         if (!Schema::hasTable('forum_posts')) {
53
-            Schema::create('forum_posts', function ($table) {
53
+            Schema::create('forum_posts', function($table) {
54 54
                 $table->increments('id');
55 55
                 $table->string('title');
56 56
                 $table->string('body', 4000);
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
     public function migrateReplies()
68 68
     {
69 69
         if (!Schema::hasTable('forum_post_replies')) {
70
-            Schema::create('forum_post_replies', function ($table) {
70
+            Schema::create('forum_post_replies', function($table) {
71 71
                 $table->increments('id');
72 72
                 $table->string('body', 4000);
73 73
                 $table->integer('post_id')->unsigned();
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
     public function addFieldsToForumPosts()
84 84
     {
85 85
         if (!Schema::hasColumn('forum_posts', 'sticky') && !Schema::hasColumn('forum_posts', 'locked')) {
86
-            Schema::table('forum_posts', function ($table) {
86
+            Schema::table('forum_posts', function($table) {
87 87
                 $table->boolean('sticky')->default(0);
88 88
                 $table->boolean('locked')->default(0);
89 89
             });
Please login to merge, or discard this patch.
src/Events/PostReply.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,6 +24,6 @@
 block discarded – undo
24 24
      */
25 25
     public function broadcastOn()
26 26
     {
27
-        return ['laravel-forum'];
27
+        return [ 'laravel-forum' ];
28 28
     }
29 29
 }
Please login to merge, or discard this patch.
src/Forum.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
 {
19 19
     public $table = 'forums';
20 20
 
21
-    public $fillable = ['name', 'description', 'category_id', 'public'];
21
+    public $fillable = [ 'name', 'description', 'category_id', 'public' ];
22 22
 
23 23
     /**
24 24
      * Eloquent Relation.
@@ -45,8 +45,8 @@  discard block
 block discarded – undo
45 45
     public function getThreadCount()
46 46
     {
47 47
         try {
48
-            $result = DB::select('SELECT COUNT(*) as count FROM `forum_posts` where forum_id = ?', [$this->id]);
49
-            return $result[0]->count;
48
+            $result = DB::select('SELECT COUNT(*) as count FROM `forum_posts` where forum_id = ?', [ $this->id ]);
49
+            return $result[ 0 ]->count;
50 50
         } catch (\Exception $e) {
51 51
             return 0;
52 52
         }
Please login to merge, or discard this patch.
src/ForumCategory.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
 {
15 15
     public $table = 'forum_categories';
16 16
 
17
-    public $fillable = ['name'];
17
+    public $fillable = [ 'name' ];
18 18
 
19 19
     /**
20 20
      * Eloquent Relation.
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
     public static function valid($data)
34 34
     {
35 35
         $rules = [
36
-            'name' => ['required', 'min:3'],
36
+            'name' => [ 'required', 'min:3' ],
37 37
         ];
38 38
         $validator = Validator::make($data, $rules);
39 39
 
Please login to merge, or discard this patch.
src/ForumPost.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
21 21
 {
22 22
     public $table = 'forum_posts';
23 23
 
24
-    public $fillable = ['title', 'body', 'forum_id', 'author_id', 'sticky', 'locked'];
24
+    public $fillable = [ 'title', 'body', 'forum_id', 'author_id', 'sticky', 'locked' ];
25 25
 
26 26
     /**
27 27
      * Eloquent Relation.
Please login to merge, or discard this patch.
src/ForumReply.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -17,8 +17,8 @@  discard block
 block discarded – undo
17 17
 {
18 18
     protected $table = 'forum_post_replies';
19 19
 
20
-    protected $hidden = [];
21
-    protected $fillable = ['body', 'post_id', 'author_id'];
20
+    protected $hidden = [ ];
21
+    protected $fillable = [ 'body', 'post_id', 'author_id' ];
22 22
 
23 23
     /**
24 24
      * Eloquent Relation.
@@ -59,6 +59,6 @@  discard block
 block discarded – undo
59 59
     public static function getReplyCount()
60 60
     {
61 61
         $results = DB::select('select COUNT(*) as count from forum_post_replies');
62
-        return $results[0]->count;
62
+        return $results[ 0 ]->count;
63 63
     }
64 64
 }
Please login to merge, or discard this patch.
src/Helpers/Sanitizer.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -19,9 +19,9 @@
 block discarded – undo
19 19
 
20 20
         $script = $dom->getElementsByTagName('script');
21 21
 
22
-        $remove = [];
22
+        $remove = [ ];
23 23
         foreach ($script as $item) {
24
-            $remove[] = $item;
24
+            $remove[ ] = $item;
25 25
         }
26 26
 
27 27
         foreach ($remove as $item) {
Please login to merge, or discard this patch.
src/Http/Controllers/ApiController.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
         $post = ForumPost::create($data);
83 83
 
84 84
         event(new PostCreated($post, $user));
85
-        return redirect()->route('laravel-forum.view.post', [$forum_id , $post->id]);
85
+        return redirect()->route('laravel-forum.view.post', [ $forum_id, $post->id ]);
86 86
     }
87 87
 
88 88
     public function forumReplyStore()
@@ -103,13 +103,13 @@  discard block
 block discarded – undo
103 103
         ];
104 104
 
105 105
         if (!ForumReply::valid($data)) {
106
-            return redirect()->route('laravel-forum.view.post', [$forum_id, $post_id]);
106
+            return redirect()->route('laravel-forum.view.post', [ $forum_id, $post_id ]);
107 107
         }
108 108
 
109 109
         $reply = ForumReply::create($data);
110 110
 
111 111
         event(new PostReply($reply, $user));
112
-        return redirect()->route('laravel-forum.view.post', [$forum_id, $post_id]);
112
+        return redirect()->route('laravel-forum.view.post', [ $forum_id, $post_id ]);
113 113
     }
114 114
 
115 115
     private function adminCheck()
Please login to merge, or discard this patch.