Resource Lifecycle hooks wrapped in a transaction
I would like to confirm, as implied by the title, that its all or nothing in terms of DB operations across the lifecycle hooks. For instance, in afterCreate hook of a resource, I intend to insert records in another table and update yet a 3rd. If I throw an exception at any stage, all preceding DB operations will also have no impact, including the resource. Is this a correct understanding of how filamentphp works? Or do I need to start the transaction explicitly?
2 Replies