Fix: Make the slug of an Article unique

This commit is contained in:
Jonathan Nielson 2024-08-04 12:35:22 -05:00
parent 0f2fb26651
commit 6b1d289506
1 changed files with 1 additions and 1 deletions

View File

@ -18,7 +18,7 @@ return new class extends Migration
// The URL-encoded version of the title, more or less. Also acts as // The URL-encoded version of the title, more or less. Also acts as
// the unique, public-facing identifier for the article // the unique, public-facing identifier for the article
$table->string('slug', 255); $table->string('slug', 255)->unique();
$table->foreignId('author_id') $table->foreignId('author_id')
->constrained(table: 'authors', indexName: 'articles_authors_id') ->constrained(table: 'authors', indexName: 'articles_authors_id')