© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago
amarafath

Custom Edit Form Input Values Not Populating Input values

I'm encountering an issue with a custom edit form. For some reason, the input values aren't getting filled. Has anyone experienced this before?
URL : http://127.0.0.1:8000/admin/leads/1/edit
<?php

namespace App\Filament\Resources\LeadResource\Pages;

use App\Filament\Resources\LeadResource;
use Filament\Forms\Components\Actions\Action;
use Filament\Forms\Components\TextInput;
use Filament\Forms\Concerns\InteractsWithForms;
use Filament\Forms\Form;
use Filament\Resources\Pages\Page;

class EditLead extends Page
{
    use InteractsWithForms;

    protected static string $resource = LeadResource::class;

    protected static string $view = 'filament.resources.lead-resource.pages.edit-lead';

    public $data = [];

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

    public function form(Form $form): Form
    {
        return $form
            ->schema([
                TextInput::make('first_name')
                    ->autofocus()
                    ->required()
                    ->maxLength(255)
                    ->placeholder(__('First Name')),
                TextInput::make('last_name')
                    ->autofocus()
                    ->required()
                    ->maxLength(255)
                    ->placeholder(__('Last Name')),
            ])->columns(2)
            ->statePath('data');
    }

    protected function getFormActions(): array
    {
        return [
            Action::make('save')
                ->label(__('filament-panels::resources/pages/edit-record.form.actions.save.label'))
                ->submit('save'),
        ];
    }

}
<?php

namespace App\Filament\Resources\LeadResource\Pages;

use App\Filament\Resources\LeadResource;
use Filament\Forms\Components\Actions\Action;
use Filament\Forms\Components\TextInput;
use Filament\Forms\Concerns\InteractsWithForms;
use Filament\Forms\Form;
use Filament\Resources\Pages\Page;

class EditLead extends Page
{
    use InteractsWithForms;

    protected static string $resource = LeadResource::class;

    protected static string $view = 'filament.resources.lead-resource.pages.edit-lead';

    public $data = [];

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

    public function form(Form $form): Form
    {
        return $form
            ->schema([
                TextInput::make('first_name')
                    ->autofocus()
                    ->required()
                    ->maxLength(255)
                    ->placeholder(__('First Name')),
                TextInput::make('last_name')
                    ->autofocus()
                    ->required()
                    ->maxLength(255)
                    ->placeholder(__('Last Name')),
            ])->columns(2)
            ->statePath('data');
    }

    protected function getFormActions(): array
    {
        return [
            Action::make('save')
                ->label(__('filament-panels::resources/pages/edit-record.form.actions.save.label'))
                ->submit('save'),
        ];
    }

}

<x-filament-panels::page>
    <x-filament-panels::form wire:submit="save">
        {{ $this->form }}

        <x-filament-panels::form.actions
            :actions="$this->getFormActions()"
        />
    </x-filament-panels::form>
</x-filament-panels::page>
<x-filament-panels::page>
    <x-filament-panels::form wire:submit="save">
        {{ $this->form }}

        <x-filament-panels::form.actions
            :actions="$this->getFormActions()"
        />
    </x-filament-panels::form>
</x-filament-panels::page>
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

Resource Edit Form Not Populating Values - Model Field Names Mapped to Table Column Names
FilamentFFilament / ❓┊help
3y ago
FileUpload: Default values for edit Form
FilamentFFilament / ❓┊help
10mo ago
TableRepeater / Repeater populating form
FilamentFFilament / ❓┊help
13mo ago
Create and Edit Users Custom input
FilamentFFilament / ❓┊help
2y ago