© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
2 replies
Lukas

Testing - get created record

Hi, when testing the Create Page form, I also associate a relationship using a
Select
Select
.

I can test whether the newly created record is present in the database using
assertDatabaseHas
assertDatabaseHas
, but how would I check whether also the
many-to-many
many-to-many
relationship was stored?

Can I somehow store the resulting new record in a variable (when calling the
create
create
action on the CreatePage test), so that I can then retrieve the ID and check the
many-to-many
many-to-many
table in a separate
assertDatabaseHas
assertDatabaseHas
call?
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

How can I get the record created from a createOptionAction?
FilamentFFilament / ❓┊help
2y ago
Get current record
FilamentFFilament / ❓┊help
3y ago
Access recently created record on CreateAction
FilamentFFilament / ❓┊help
3y ago