minami
minami
FFilament
Created by minami on 5/12/2025 in #❓┊help
Import action afterCreate / afterSave not working to get parent ID
I found the answer. for someone out there who might need it. when we want to add data via the relationship name it will fail :
$this->record->rate_card()->create([]);
$this->record->rate_card()->create([]);
only can add via model directly :
protected function afterCreate(): void
{
RateCard::create([
'target_id' => $this->record->id,
]);
}
protected function afterCreate(): void
{
RateCard::create([
'target_id' => $this->record->id,
]);
}
3 replies