Β© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filamentβ€’3y agoβ€’
4 replies
Chriis

Using $record into beforeCreate() method

Hi everyone, I want to generate a PDF when a user creates a resource, but I'm not sure where to place this logic. I need to have the $record available to pass it to the view used for generating the PDF, and I also need to do this before the record is saved into the database (to save the document path).

After some research in the documentation, I found the lifecycle hook beforeCreate(). However, the fact that the method takes no arguments poses an issue for using $record.

So, what would be the best way to accomplish this ?

Help would appreciated πŸ™‚
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 to bring current record into canAccess() method code?
FilamentFFilament / β“β”Šhelp
2y ago
beforeCreate on RelationManager
FilamentFFilament / β“β”Šhelp
2y ago
How to use action and form in beforecreate() the record
FilamentFFilament / β“β”Šhelp
3y ago
How can I prevent the record creation if the conditions are not met in the BeforeCreate method?
FilamentFFilament / β“β”Šhelp
3y ago