Insert to one table from another table

Hi, in my filament project i have two tables 'Loan' and 'Payment'. When i insert data to Loan table using LoanResource Form I also want to send some of the data to Payment table. I tried using afterCreate() life cycle hook, but i could not pass data to it. Is there any other way, like custom controller.
Was this page helpful?