JL
Notification after Import Action finishes
Hi,
when I use the import action, I see the first notification, but I can't see the notification when this finishes.
in the notification table I have the rows:
Filament\Notifications\DatabaseNotification
{"actions":[],"body":"Your question import has completed and 3 rows imported.","color":null,"duration":"persistent","icon":"heroicon-o-check-circle","iconColor":"success","status":"success","title":"Importaci\u00f3n completada","view":"filament-notifications::notification","viewData":[],"format":"filament"}
any idea?
2 replies
Add value to field in pivot table in CreateAction
Hello I have this code in v2
return $table
->columns(CategoryResource::getTableFields())
->filters([])
->headerActions([
Tables\Actions\CreateAction::make()
->using(function (HasRelationshipTable $livewire, array $data): Model {
$parentCategory = $livewire->getRelationship()->getParent();
$dataPivot['pivotorder'] = $parentCategory->subcategories()->max('pivotorder') + 1;
return $livewire->getRelationship()->create($data,$dataPivot);
}),
this code worked.
In v3
return $table
->recordTitleAttribute('name')
->columns(CategoryResource::getTableFields())
->filters([])
->headerActions([
CreateAction::make()
->using(function (array $data, string $model): Model {
return $model::create($data);
})
])
first, in headersActions never enters. but in emptyStateActions, it does.
second, how i can get the relationship for get the parent category?
thx
6 replies