FilamentF
Filamentβ€’3y ago
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 πŸ™‚
Was this page helpful?