Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

philipbaginski's avatar

Action Select field.

I have a field in action:

public function fields()
    {
        return [
            Select::make('Event', 'event_id')
                ->options(\App\Models\Event::orderBy('date', 'desc')
                ->pluck('date', 'id'))
                ->displayUsingLabels()
                ->searchable(),
        ];
    }

Select field in action modal shows raw format of date from database. I need to format this date. Any idea?

0 likes
1 reply
philipbaginski's avatar

Problem fixed:

public function fields()
    {
        return [
            Select::make('Event', 'event_id')
                ->options(\App\Models\Event::orderBy('date', 'desc')
                ->pluck('date', 'id'))
                ->map
				->format->('Y-m-d')
                ->searchable(),
        ];
    }

Please or to participate in this conversation.