I am currently working on a Filament PHP app and I have a problem: I want to show the username of the creator of a note (in my case) and I want to make the field unmodifiable in Filament. So I have thought of this:
Select::make('user_id')
->options([
User::query()
->select([
DB::raw("name as name"),
'id',
])
->where('id', auth()->id())
->pluck('name', 'id')
->toArray()
])
->default(
auth()->id()
)->label(__('messages.created_by'))
->disabled(),
If i disable the field nothing gets written to the database. I get basically null.
Is there a way to disable the Field and ensure that the user_id gets written into the database?