F
Filament16mo ago
Ninja++

Wizard Step type error

I have gone through the video on Dans youtube showing how to implement the wizard, however when i go to the create page it gives me this error.
App\Filament\Resources\ProjectsResource\Pages\CreateProjects::{closure}(): Argument #1 ($step) must be of type Filament\Forms\Components\Wizard\Step, Filament\Forms\Components\Wizard given
App\Filament\Resources\ProjectsResource\Pages\CreateProjects::{closure}(): Argument #1 ($step) must be of type Filament\Forms\Components\Wizard\Step, Filament\Forms\Components\Wizard given
I went back through the video and the wizard documentation page and i don't understand what i am doing wrong.
Solution:
```php public function getSteps(): array { return [ Wizard\Step::make('Order')...
Jump to solution
6 Replies
Patrick Boivin
Patrick Boivin16mo ago
Can you share your code?
Ninja++
Ninja++OP16mo ago
Yes sure which part should i share?
Patrick Boivin
Patrick Boivin16mo ago
The Wizard code and the steps
Ninja++
Ninja++OP16mo ago
<?php

namespace App\Filament\Resources\ProjectsResource\Pages;

use Filament\Pages\Actions;
use Forms\Components\Wizard\Step;
use Filament\Forms\Components\Wizard;
use Filament\Actions\Concerns\HasWizard;
use Filament\Forms\Components\TextInput;
use Filament\Resources\Pages\CreateRecord;
use App\Filament\Resources\ProjectsResource;
use Filament\Infolists\Components\Concerns\HasWeight;
use Filament\Resources\Pages\Concerns\HasWizard as ConcernsHasWizard;

class CreateProjects extends CreateRecord
{

use CreateRecord\Concerns\HasWizard;

protected static string $resource = ProjectsResource::class;

public function getSteps(): array
{
return [

Wizard::make([
Wizard\Step::make('Order')
->schema([
TextInput::make('name')->required(),

]),
Wizard\Step::make('Delivery')
->schema([
TextInput::make('email')->required(),
]),
Wizard\Step::make('Billing')
->schema([
TextInput::make('phone')->required(),
]),
])
];






}
}
<?php

namespace App\Filament\Resources\ProjectsResource\Pages;

use Filament\Pages\Actions;
use Forms\Components\Wizard\Step;
use Filament\Forms\Components\Wizard;
use Filament\Actions\Concerns\HasWizard;
use Filament\Forms\Components\TextInput;
use Filament\Resources\Pages\CreateRecord;
use App\Filament\Resources\ProjectsResource;
use Filament\Infolists\Components\Concerns\HasWeight;
use Filament\Resources\Pages\Concerns\HasWizard as ConcernsHasWizard;

class CreateProjects extends CreateRecord
{

use CreateRecord\Concerns\HasWizard;

protected static string $resource = ProjectsResource::class;

public function getSteps(): array
{
return [

Wizard::make([
Wizard\Step::make('Order')
->schema([
TextInput::make('name')->required(),

]),
Wizard\Step::make('Delivery')
->schema([
TextInput::make('email')->required(),
]),
Wizard\Step::make('Billing')
->schema([
TextInput::make('phone')->required(),
]),
])
];






}
}
Solution
LeandroFerreira
LeandroFerreira16mo ago
public function getSteps(): array
{
return [
Wizard\Step::make('Order')
->schema([
TextInput::make('name')->required(),

]),
Wizard\Step::make('Delivery')
->schema([
TextInput::make('email')->required(),
]),
Wizard\Step::make('Billing')
->schema([
TextInput::make('phone')->required(),
]),
];
}
public function getSteps(): array
{
return [
Wizard\Step::make('Order')
->schema([
TextInput::make('name')->required(),

]),
Wizard\Step::make('Delivery')
->schema([
TextInput::make('email')->required(),
]),
Wizard\Step::make('Billing')
->schema([
TextInput::make('phone')->required(),
]),
];
}
Ninja++
Ninja++OP16mo ago
Thank you very much @Leandro Ferreira I see what i did wrong now
Want results from more Discord servers?
Add your server