Notification action not working becuase $table must before initialization
public static function toFilamentNotification(): FilamentNotification
{
return FilamentNotification::make()
->constructUsing(function (array $data) {
[
'user_id' => $userId,
'domain_check_id' => $domainCheckId,
'message' => $message,
'categories' => $categories
] = $data;
return new static(
user: User::find($userId),
domainCheck: DomainCheck::find($domainCheckId),
message: $message,
categories: $categories,
);
})->message(fn(self $notification) => $notification->message)
->description(fn(self $notification) => $notification->categories)
->actions([
Action::make('edit')
->url(fn (DomainCheck $record): string => route('DomainCheckResource.edit', $record))
->openUrlInNewTab()
]);
} public static function toFilamentNotification(): FilamentNotification
{
return FilamentNotification::make()
->constructUsing(function (array $data) {
[
'user_id' => $userId,
'domain_check_id' => $domainCheckId,
'message' => $message,
'categories' => $categories
] = $data;
return new static(
user: User::find($userId),
domainCheck: DomainCheck::find($domainCheckId),
message: $message,
categories: $categories,
);
})->message(fn(self $notification) => $notification->message)
->description(fn(self $notification) => $notification->categories)
->actions([
Action::make('edit')
->url(fn (DomainCheck $record): string => route('DomainCheckResource.edit', $record))
->openUrlInNewTab()
]);
}Typed property Filament\Tables\Actions\Action::$table must not be accessed before initializationTyped property Filament\Tables\Actions\Action::$table must not be accessed before initializationit's because the url has a function, but i couldn't find a solution for the error,. Anyone has a idea?