Sevendays-Digital / filament-nested-resources

MIT License
17 stars 9 forks source link

Confilct with Multi-Step Form Wizards #16

Open w452m200 opened 1 year ago

w452m200 commented 1 year ago

Trait method Filament\Resources\Pages\CreateRecord\Concerns\HasWizard::form has not been applied as App\Filament\Resources\MspManager\ServiceResource\Pages\CreateService::form, because of collision with SevendaysDigital\FilamentNestedResources\ResourcePages\NestedPage::form

In create nested resource


<?php

namespace App\Filament\Resources\MspManager\ServiceResource\Pages;

use App\Filament\Resources\MspManager\ServiceResource;
use Filament\Pages\Actions;
use Filament\Resources\Pages\CreateRecord;
use SevendaysDigital\FilamentNestedResources\ResourcePages\NestedPage;
use Filament\Forms\Components\Wizard\Step;
use Filament\Forms\Components\Card;
use Filament\Resources\Pages\CreateRecord\Concerns\HasWizard;

class CreateService extends CreateRecord
{
    use NestedPage; 
    use HasWizard; 

    protected static string $resource = ServiceResource::class;

    protected function getSteps(): array
    {
        return [
            Step::make('Order Details')
                ->schema([
                    Card::make(ServiceResource::getFormSchema())->columns(),
                ]),

            Step::make('Order Items')
                ->schema([
                    Card::make(ServiceResource::getFormSchema('items')),
                ]),
        ];
    }
}