Skip to content

Commit fc0fe9a

Browse files
tabunagithub-actions[bot]
authored andcommitted
Fixed code style
1 parent 4b2a5c1 commit fc0fe9a

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

app/Models/Post.php

+10-10
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
#[ScopedBy([PublishedScope::class])]
3535
class Post extends Model
3636
{
37-
use AsSource, Chartable, Filterable, HasAuthor, HasFactory, Likeable, LogsActivityFillable, Searchable, Taggable, SoftDeletes;
37+
use AsSource, Chartable, Filterable, HasAuthor, HasFactory, Likeable, LogsActivityFillable, Searchable, SoftDeletes, Taggable;
3838

3939
/**
4040
* @var string[]
@@ -53,11 +53,11 @@ class Post extends Model
5353
* @var array
5454
*/
5555
protected $casts = [
56-
'title' => 'string',
57-
'content' => 'string',
58-
'slug' => 'string',
59-
'type' => PostTypeEnum::class,
60-
'status' => StatusEnum::class,
56+
'title' => 'string',
57+
'content' => 'string',
58+
'slug' => 'string',
59+
'type' => PostTypeEnum::class,
60+
'status' => StatusEnum::class,
6161
'published_at' => 'datetime',
6262
];
6363

@@ -86,23 +86,22 @@ public static function boot()
8686

8787
static::creating(function ($post) {
8888

89-
if($post->published_at === null) {
89+
if ($post->published_at === null) {
9090
$post->published_at = now();
9191
}
9292

9393
$slug = Str::slug($post->title);
9494
$i = 1;
9595

9696
while (static::where('slug', $slug)->withTrashed()->exists()) {
97-
$slug = Str::slug($post->title) . '-' . $i++;
97+
$slug = Str::slug($post->title).'-'.$i++;
9898
}
9999

100-
101100
$post->slug = $slug;
102101
});
103102

104103
static::created(function (Post $post) {
105-
dispatch(fn() => $this->notifyAboutPublishedPost($post))->afterResponse();
104+
dispatch(fn () => $this->notifyAboutPublishedPost($post))->afterResponse();
106105
});
107106
}
108107

@@ -203,6 +202,7 @@ public function getDescriptionAttribute()
203202

204203
/**
205204
* @param Post $post
205+
*
206206
* @return void
207207
*/
208208
public function notifyAboutPublishedPost(Post $post): void

0 commit comments

Comments
 (0)