@@ -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 |
@@ -8,14 +8,14 @@ |
||
8 | 8 | { |
9 | 9 | public function up() |
10 | 10 | { |
11 | - Schema::table('users', function (Blueprint $table) { |
|
11 | + Schema::table('users', function(Blueprint $table) { |
|
12 | 12 | $table->timestamp('comment_banned_until')->nullable()->after('remember_token'); |
13 | 13 | }); |
14 | 14 | } |
15 | 15 | |
16 | 16 | public function down() |
17 | 17 | { |
18 | - Schema::table('users', function (Blueprint $table) { |
|
18 | + Schema::table('users', function(Blueprint $table) { |
|
19 | 19 | $table->dropColumn('comment_banned_until'); |
20 | 20 | }); |
21 | 21 | } |
@@ -132,12 +132,12 @@ discard block |
||
132 | 132 | public function selectUser($userName): void |
133 | 133 | { |
134 | 134 | if ($this->replyState['body']) { |
135 | - $this->replyState['body'] = preg_replace('/@(\w+)$/', '@' . str_replace(' ', '_', Str::lower($userName)) . ' ', |
|
135 | + $this->replyState['body'] = preg_replace('/@(\w+)$/', '@'.str_replace(' ', '_', Str::lower($userName)).' ', |
|
136 | 136 | $this->replyState['body']); |
137 | 137 | // $this->replyState['body'] =$userName; |
138 | 138 | $this->users = []; |
139 | 139 | } elseif ($this->editState['body']) { |
140 | - $this->editState['body'] = preg_replace('/@(\w+)$/', '@' . str_replace(' ', '_', Str::lower($userName)) . ' ', |
|
140 | + $this->editState['body'] = preg_replace('/@(\w+)$/', '@'.str_replace(' ', '_', Str::lower($userName)).' ', |
|
141 | 141 | $this->editState['body']); |
142 | 142 | $this->users = []; |
143 | 143 | } |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | public function getUsers($searchTerm): void |
153 | 153 | { |
154 | 154 | if (!empty($searchTerm)) { |
155 | - $this->users = User::where('name', 'like', '%' . $searchTerm . '%')->take(5)->get(); |
|
155 | + $this->users = User::where('name', 'like', '%'.$searchTerm.'%')->take(5)->get(); |
|
156 | 156 | } else { |
157 | 157 | $this->users = []; |
158 | 158 | } |