@@ -21,7 +21,7 @@  | 
                                                    ||
| 21 | 21 |      { | 
                                                        
| 22 | 22 | return [  | 
                                                        
| 23 | 23 | 'body' => fake()->text,  | 
                                                        
| 24 | -            'user_id' => function () { | 
                                                        |
| 24 | +            'user_id' => function() { | 
                                                        |
| 25 | 25 | return User::factory()->create()->id;  | 
                                                        
| 26 | 26 | },  | 
                                                        
| 27 | 27 | 'parent_id' => null,  | 
                                                        
@@ -10,7 +10,7 @@  | 
                                                    ||
| 10 | 10 | */  | 
                                                        
| 11 | 11 | public function up(): void  | 
                                                        
| 12 | 12 |      { | 
                                                        
| 13 | -        Schema::create('comments', function (Blueprint $table) { | 
                                                        |
| 13 | +        Schema::create('comments', function(Blueprint $table) { | 
                                                        |
| 14 | 14 | $table->id();  | 
                                                        
| 15 | 15 |              $table->foreignId('user_id')->constrained()->onDelete('cascade'); | 
                                                        
| 16 | 16 |              $table->foreignId('parent_id')->nullable()->constrained('comments')->onDelete('cascade'); | 
                                                        
@@ -10,7 +10,7 @@  | 
                                                    ||
| 10 | 10 | */  | 
                                                        
| 11 | 11 | public function up(): void  | 
                                                        
| 12 | 12 |      { | 
                                                        
| 13 | -        Schema::create('comment_likes', function (Blueprint $table) { | 
                                                        |
| 13 | +        Schema::create('comment_likes', function(Blueprint $table) { | 
                                                        |
| 14 | 14 | $table->id();  | 
                                                        
| 15 | 15 |              $table->foreignId('user_id')->nullable(); | 
                                                        
| 16 | 16 |              $table->foreignId('comment_id'); | 
                                                        
@@ -17,7 +17,7 @@  | 
                                                    ||
| 17 | 17 | */  | 
                                                        
| 18 | 18 | public function register(): void  | 
                                                        
| 19 | 19 |      { | 
                                                        
| 20 | -        $this->app->singleton('markdown', function () { | 
                                                        |
| 20 | +        $this->app->singleton('markdown', function() { | 
                                                        |
| 21 | 21 | $environment = new Environment([  | 
                                                        
| 22 | 22 | 'allow_unsafe_links' => false,  | 
                                                        
| 23 | 23 | 'html_input' => 'strip'  | 
                                                        
@@ -18,7 +18,7 @@  | 
                                                    ||
| 18 | 18 | */  | 
                                                        
| 19 | 19 | public function register(): void  | 
                                                        
| 20 | 20 |      { | 
                                                        
| 21 | -        $this->app->bind(CommentPolicy::class, function ($app) { | 
                                                        |
| 21 | +        $this->app->bind(CommentPolicy::class, function($app) { | 
                                                        |
| 22 | 22 | return new CommentPolicy;  | 
                                                        
| 23 | 23 | });  | 
                                                        
| 24 | 24 | |
@@ -24,7 +24,7 @@  | 
                                                    ||
| 24 | 24 | $ip = request()->ip();  | 
                                                        
| 25 | 25 | $userAgent = request()->userAgent();  | 
                                                        
| 26 | 26 |          if (auth()->user()) { | 
                                                        
| 27 | -            return User::with('likes')->whereHas('likes', function ($q) { | 
                                                        |
| 27 | +            return User::with('likes')->whereHas('likes', function($q) { | 
                                                        |
| 28 | 28 |                  $q->where('comment_id', $this->id); | 
                                                        
| 29 | 29 | })->count();  | 
                                                        
| 30 | 30 | }  |