diff --git a/database/migrations/2024_02_05_014414_create_articles_table.php b/database/migrations/2024_02_05_014414_create_articles_table.php index 5b81d37..ca55f4b 100644 --- a/database/migrations/2024_02_05_014414_create_articles_table.php +++ b/database/migrations/2024_02_05_014414_create_articles_table.php @@ -18,7 +18,7 @@ return new class extends Migration // The URL-encoded version of the title, more or less. Also acts as // the unique, public-facing identifier for the article - $table->string('slug', 255); + $table->string('slug', 255)->unique(); $table->foreignId('author_id') ->constrained(table: 'authors', indexName: 'articles_authors_id')