© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
6 replies
Fossil

Value not updated when clicking save

I have a column called
videos_id
videos_id
in my table. And a videos table where that ID is the primary key
id
id
and a column called
title
title
. In this dropdown on the Filament Edit page I want to show the title and not the ID. So I am doing this:

                        Select::make('videos_id')
                            ->getSearchResultsUsing(fn (string $search): array => Video::where('title', 'like', "%{$search}%")->limit(50)->pluck('title', 'id')->toArray())
                            ->getOptionLabelUsing(
                                function ($value) {
                                    $video = Video::find($value);
                                    $title = $video ? $video->title : null;
                                    $started = $video ? $video->started : null;

                                    $year = null;
                                    if ($started !== null) {
                                        $carbonDate = Carbon::createFromDate($started);
                                        $year = $carbonDate->format('Y');
                                    }

                                    return $title !== null ? $title.' ('.$year.')' : null;
                                }
                            )
                            ->searchable()
                            ->live()
                            ->default(0)
                            ->label('Video ID'),
                        Select::make('videos_id')
                            ->getSearchResultsUsing(fn (string $search): array => Video::where('title', 'like', "%{$search}%")->limit(50)->pluck('title', 'id')->toArray())
                            ->getOptionLabelUsing(
                                function ($value) {
                                    $video = Video::find($value);
                                    $title = $video ? $video->title : null;
                                    $started = $video ? $video->started : null;

                                    $year = null;
                                    if ($started !== null) {
                                        $carbonDate = Carbon::createFromDate($started);
                                        $year = $carbonDate->format('Y');
                                    }

                                    return $title !== null ? $title.' ('.$year.')' : null;
                                }
                            )
                            ->searchable()
                            ->live()
                            ->default(0)
                            ->label('Video ID'),


Which works fine. But when I change the value and click Save. The old ID is still present on the row.

Devtools show a POST request to
/livewire/update
/livewire/update
with JSON data which does contain the NEW id. So I am puzzled why this happens.

{
  "data": {
    "data": [
      {
        "id": 10,
        "videos_id": "41",
{
  "data": {
    "data": [
      {
        "id": 10,
        "videos_id": "41",


Removed all the other data from the JSON to make it readable.
Solution
You should never have fields with the same name/ID. Give it a different name and use
getStateUsing()
getStateUsing()
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
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

Form is not updated after saveRelationshipsUsingCallback
FilamentFFilament / ❓┊help
3y ago
Relationship repeater fields are reset when clicking save button, but saves actually.
FilamentFFilament / ❓┊help
2y ago
Cannot save data after clicking Save button
FilamentFFilament / ❓┊help
2mo ago
V4 Enum not save the value on Radio
FilamentFFilament / ❓┊help
4mo ago