© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
10 replies
DariusIII

auth()->user-> not filled in form

I have an issue with username not being filled neither with
deafult()
deafult()
or
reactive()
reactive()
. It looks like auth()->user()->name not being used at all. There is no error whatsoever shown, just data being ignored. Currently i am filling those with
mutateFormDataBeforeSave
mutateFormDataBeforeSave
, but i would like to have it in form directly.

Forms\Components\Checkbox::make('checked')
                        ->label('Checked')
                        ->reactive()
                        ->afterStateUpdated(fn ($state, callable $set) => $state === true ? $set('checked_by', auth()->user()->name) : $set('checked_by', null))
                        ->afterStateUpdated(fn ($state, callable $set) => $state === true ? $set('checked_time', now()->toDateTimeString()) : $set('checked_time', null)),
Forms\Components\Checkbox::make('checked')
                        ->label('Checked')
                        ->reactive()
                        ->afterStateUpdated(fn ($state, callable $set) => $state === true ? $set('checked_by', auth()->user()->name) : $set('checked_by', null))
                        ->afterStateUpdated(fn ($state, callable $set) => $state === true ? $set('checked_time', now()->toDateTimeString()) : $set('checked_time', null)),


Checked time works as it should, i have issue only with checked_by field.
Solution
you can chain ->disabled()->dehydrated() to make it return
Jump to solution
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

Form does not display filled data.
FilamentFFilament / ❓┊help
2y ago
Action->form() not getting filled when reusing form
FilamentFFilament / ❓┊help
17mo ago
MorphToSelect not being filled on form load
FilamentFFilament / ❓┊help
3y ago
filled form on custom modals
FilamentFFilament / ❓┊help
2y ago