© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•15mo 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(),
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Tenant user pivot values
FilamentFFilament / ❓┊help
2y ago
Editing select label with pivot values
FilamentFFilament / ❓┊help
2y ago
attach action form and pivot values
FilamentFFilament / ❓┊help
2y ago
Related record, pivot extra column values
FilamentFFilament / ❓┊help
3y ago