Skip to content

->default() on TextEntry (possibly other components) on create form causes exception #17319

@iamgmd

Description

@iamgmd

Package

filament/filament

Package Version

v4.0.0pa l

Laravel Version

v12

Livewire Version

v3

PHP Version

8.4.11

Problem description

If you use ->default() on a Text Entry (maybe other components) on a create form, it raises an exception of 'Schema has no [record()] or [state()] set.' using ->state works fine.

TextEntry::make('name') ->hiddenLabel() ->size(TextSize::Large) ->weight(FontWeight::SemiBold) // ->state(fn($record) => $record?->name ?? '---'), ->default('New Company'),

Expected behavior

It should use the value of ->default() like it does it you use ->state

Steps to reproduce

Place a TextEntry component in the $schema and add ->default('')

Reproduction repository (issue will be closed if this is not valid)

https://github.com/iamgmd/bug-filament-default-issue.git

Relevant log output

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    Status

    Todo

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions