F
Filament2w ago
zidd

Wrong Pivot Values

So i've implement ulid as primary key on my table, when submit the data mysql error like this:
SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`cita-kita`.`blog_category_blog_post`, CONSTRAINT `blog_category_blog_post_blog_post_id_foreign` FOREIGN KEY (`blog_post_id`) REFERENCES `blog_posts` (`id`) ON DELETE CASCADE) (Connection: mysql, SQL: insert into `blog_category_blog_post` (`blog_category_id`, `blog_post_id`) values (01jenzmcnwkzh12v47xbf65vdr, 1))
SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`cita-kita`.`blog_category_blog_post`, CONSTRAINT `blog_category_blog_post_blog_post_id_foreign` FOREIGN KEY (`blog_post_id`) REFERENCES `blog_posts` (`id`) ON DELETE CASCADE) (Connection: mysql, SQL: insert into `blog_category_blog_post` (`blog_category_id`, `blog_post_id`) values (01jenzmcnwkzh12v47xbf65vdr, 1))
Why the value of blog_post_id is = 1 instead of ulid value? Here's the code
Select::make('categories')
->multiple()
->preload()
->createOptionForm(BlogCategory::getForm())
->searchable()
->relationship('categories', 'name')
->columnSpanFull(),
Select::make('categories')
->multiple()
->preload()
->createOptionForm(BlogCategory::getForm())
->searchable()
->relationship('categories', 'name')
->columnSpanFull(),
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server