Skip to content

Commit

Permalink
Fix NewsCategory replicate
Browse files Browse the repository at this point in the history
  • Loading branch information
felixgilles committed Jan 21, 2025
1 parent 4c2ce52 commit 694dcfa
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/Models/NewsCategory.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
* @property Carbon|null $created_at
* @property Carbon|null $updated_at
* @property Carbon|null $deleted_at
* @property array<array-key, mixed>|null $meta
* @property-read string|null $seo_robots
* @property-read string|null $seo_title
* @property-read string|null $seo_description
Expand Down
1 change: 1 addition & 0 deletions src/Models/NewsPost.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
* @property Carbon|null $created_at
* @property Carbon|null $updated_at
* @property Carbon|null $deleted_at
* @property array<array-key, mixed>|null $meta
* @property-read string|null $seo_robots
* @property-read string|null $seo_title
* @property-read string|null $seo_description
Expand Down
4 changes: 2 additions & 2 deletions src/Nova/NewsCategory.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,8 @@ public function replicate(): static
return tap(parent::replicate(), function ($resource) {
$model = $resource->model();

$model->title = $model->title.' (copy)';
$model->slug = Str::slug($model->title);
$model->name .= ' (copy)';
$model->slug = Str::slug($model->name);
});
}
}

0 comments on commit 694dcfa

Please sign in to comment.