© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
6 replies
zito

default value on form select not populating

I am attempting to have a value preselected when the Select item loads on a form. I only found two references to the default function in the docs, but no explanation on how to use it. I assume you pass an item that is in the options collection. Here is a snippet of what I tried:

$roles = Role::all()->pluck('name', 'id');
$defaultRole = $roles->first();

Select::make('role')
->options($roles)
->default($defaultRole)

Any reason why this isn't populating the default value?
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 select assign default value
FilamentFFilament / ❓┊help
3y ago
PAGE form field default not populating field
FilamentFFilament / ❓┊help
6mo ago
Form select default value doesn’t work
FilamentFFilament / ❓┊help
4w ago
Form Builder: Native select default value bug
FilamentFFilament / ❓┊help
3y ago