© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
31 replies
Jr.Pikong

default value in custom page

Hi , how to add default value for textInput in custom page ? I try to use afterStateHydrated still not working.

class AddBudgetPlanner extends Page implements HasForms
{
    use InteractsWithForms, InteractsWithActions, HasPageSidebar;

    protected static string $resource = BranchResource::class;
    protected static string $view = 'filament.resources.branch-resource.pages.create-budget-planner';
    public Branch $record;
    protected static ?string $model = Branch::class;

    public function getBreadcrumb(): ?string
    {
        return __('Manage Branch Budget Planner');
    }

    public function form(Form $form): Form
    {
        return $form->schema([
            TextInput::make('code')->afterStateHydrated(fn(TextInput $component) => $component->state('heloss'))
        ]);
    }
class AddBudgetPlanner extends Page implements HasForms
{
    use InteractsWithForms, InteractsWithActions, HasPageSidebar;

    protected static string $resource = BranchResource::class;
    protected static string $view = 'filament.resources.branch-resource.pages.create-budget-planner';
    public Branch $record;
    protected static ?string $model = Branch::class;

    public function getBreadcrumb(): ?string
    {
        return __('Manage Branch Budget Planner');
    }

    public function form(Form $form): Form
    {
        return $form->schema([
            TextInput::make('code')->afterStateHydrated(fn(TextInput $component) => $component->state('heloss'))
        ]);
    }
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Troubleshooting Default Value Display in Custom Resource Page
FilamentFFilament / ❓┊help
3y ago
retrieve Radio value in custom page.
FilamentFFilament / ❓┊help
3y ago
TextInput default value on edit page
FilamentFFilament / ❓┊help
2y ago
TextInput default value at ViewResource page
FilamentFFilament / ❓┊help
3y ago