diff --git a/app/Models/SkinChroma.php b/app/Models/SkinChroma.php index 86415e5..25f1290 100644 --- a/app/Models/SkinChroma.php +++ b/app/Models/SkinChroma.php @@ -25,11 +25,10 @@ class SkinChroma extends Model public function sluggable(): array { - $slug = $this->chroma_name.' '.$this->skin_name; - + // chroma name + skin name return [ 'slug' => [ - 'source' => $slug, + 'source' => ['chroma_name', 'skin_name'], ], ]; } diff --git a/database/migrations/2023_11_01_135724_add_slug_to_champions.php b/database/migrations/2023_11_01_135724_add_slug_to_champions.php new file mode 100644 index 0000000..1ce9268 --- /dev/null +++ b/database/migrations/2023_11_01_135724_add_slug_to_champions.php @@ -0,0 +1,28 @@ +string('slug')->after('release_patch')->unique()->nullable(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('champions', function (Blueprint $table) { + $table->dropColumn('slug'); + }); + } +}; diff --git a/database/migrations/2023_11_01_140156_add_slug_to_champion_skins.php b/database/migrations/2023_11_01_140156_add_slug_to_champion_skins.php new file mode 100644 index 0000000..2169342 --- /dev/null +++ b/database/migrations/2023_11_01_140156_add_slug_to_champion_skins.php @@ -0,0 +1,28 @@ +string('slug')->after('splash_artist')->unique()->nullable(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('champion_skins', function (Blueprint $table) { + $table->dropColumn('slug'); + }); + } +}; diff --git a/database/migrations/2023_11_01_140243_add_slug_to_skin_chromas.php b/database/migrations/2023_11_01_140243_add_slug_to_skin_chromas.php new file mode 100644 index 0000000..5e96307 --- /dev/null +++ b/database/migrations/2023_11_01_140243_add_slug_to_skin_chromas.php @@ -0,0 +1,28 @@ +string('slug')->after('chroma_image')->nullable(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('skin_chromas', function (Blueprint $table) { + $table->dropColumn('slug'); + }); + } +};