Replicate to a different Model/Table
Hello, I am wondering if it's possible to replciate a record to a different table? I tried something like the below:
ReplicateAction::make()->excludeAttributes(['instance_id','ruleId'])->beforeReplicaSaved(function (Model2 $replica): void{ })
But get an error stating I must use the same Model as the record.
Any help appreciated. Thanks
Solution:Jump to solution
GitHub
Action Β· filamentphp filament Β· Discussion #11952
Package Actions Package Version v3.0.0 How can we help you? How do I create a table action that copies all record contents from one resource table to another resource table?
5 Replies
Make your own action, copy it and initiate a new record to your other table
Solution
GitHub
Action Β· filamentphp filament Β· Discussion #11952
Package Actions Package Version v3.0.0 How can we help you? How do I create a table action that copies all record contents from one resource table to another resource table?
You're my new favourite person, thank you very much!
Yeah, I knew that was an option, was just hoping there was another way. I'll try Leandro's suggestion. Thanks for your input!
So Leandro's answer is exactly what I was saying π
Sorry, I am too novice perhaps (you can be my second favourite) π Thank you both, it worked a treat.