GuavaCZ / tutorials

MIT License
39 stars 7 forks source link

Adds Closure to the actions' property types. #15

Closed fsamapoor closed 2 months ago

fsamapoor commented 2 months ago

When trying to use a Closure for customizing the actions, it throws a TypeError: "Cannot assign Closure to property Guava\Tutorials\Steps\Step::$nextStepAction of type ?Guava\Tutorials\Filament\TutorialAction"

Step::make('docs')
    ->nextStepAction(
        fn (NextStepAction $action) => $action->icon('heroicon-o-document-text')
    ),

As mentioned in the Customizing actions section, all four actions accept Closure. Therefore, the corresponding properties should also include Closure in their types.

public function nextStepAction(TutorialAction | Closure | null $action): static
{
    $this->nextStepAction = $action;

    return $this;
}
github-actions[bot] commented 2 months ago

:tada: This PR is included in version 1.1.0 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket: