Fix: Make the slug of an Article unique
This commit is contained in:
parent
0f2fb26651
commit
6b1d289506
|
|
@ -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')
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue