How to extract a form object in Filament V2?

Received a great pointer yesterday to here for Custom Pages https://www.youtube.com/watch?v=8Di6Yrqgsl8
Problem is, it's for V3, and I'm trying to finish my old V2 project first before migrating to V3

The dashboard renders, but the form does not 😦
Tried consulting this, but still feel stuck. Any help would be much appreciated!
https://livewire.laravel.com/docs/forms#extracting-a-form-object

Custom Page CompanyMembers.php
<?php

namespace App\Filament\Pages;

use Filament\Pages\Page;
use Filament\Resources\Form;
use Filament\Forms\Components\Toggle;
use Filament\Forms\Contracts\Hasforms;
use Filament\Forms\Components\TextInput;
use Filament\Forms\Concerns\InteractsWithForms;

class CompanyMembers extends Page implements Hasforms
{
    use InteractsWithForms;

    public ?array $data = [];

    protected static ?string $model = CompanyMembers::class;

    protected static ?string $navigationIcon = 'heroicon-o-user';

    protected static ?string $modelLabel = '社員数ブレイクダウン';

    protected static string $view = 'filament.pages.company-members';

    public function mount(): void {
        $this->form->fill();
    }

    public static function form(Form $form): Form
    {
        return $form
            ->schema([
                TextInput::make('total')->placeholder('10人')->label('トータル'),
                TextInput::make('members-20s')->placeholder('2人')->label('20代'),
                TextInput::make('members-30s')->placeholder('0人')->label('30代'),
                TextInput::make('members-40s')->placeholder('4人')->label('40代'),
                TextInput::make('members-50s')->placeholder('3人')->label('50代'),
                TextInput::make('members-60s')->placeholder('1人')->label('60代'),
                Toggle::make('daiku')->label('専属大工(あり・なし)'),
            ])
            ->statePath('data');
    }
}

Blade (adjusted x-filament for V2)
<x-filament::page>
    <x-filament::form>
        {{ $this->form }}
    </x-filament::form>
</x-filament::page>
YouTubeFilament Daily
If you want to use a Filament form outside of the Resource, here's one example.

Original tutorial. Filament: Edit Only Single Record with Custom Page https://laraveldaily.com/post/filament-edit-only-single-record-custom-page
Laravel
A full-stack framework for Laravel that takes the pain out of building dynamic UIs.
Was this page helpful?