© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago
Kaaiman

Different query results with Laravel Octane

I am trying to query results, but with Octane I get different results.

Within an attach action I am trying to do the following query:
 Forms\Components\Select::make('recordId')
                            ->label('Product')
                            ->live()
                            ->options(
                                fn () => Product::query()
                                    ->whereNotIn('id', $this->ownerRecord->products()->pluck('id'))
                                    ->orWhereNull('project_id')
                                    ->orWhere('project_id', $this->ownerRecord->project_id)
                                    ->pluck('name', 'id')
                            )
                            ->afterStateUpdated(function ($state, Forms\Set $set) {
                                $set('price', Product::findOrFail($state)?->default_price); // @phpstan-ignore-line
                                $set('token_price', Product::findOrFail($state)?->default_price / $this->ownerRecord->project->token_price); // @phpstan-ignore-line
                            })
                            ->searchable()
                            ->preload()
                            ->required(),
 Forms\Components\Select::make('recordId')
                            ->label('Product')
                            ->live()
                            ->options(
                                fn () => Product::query()
                                    ->whereNotIn('id', $this->ownerRecord->products()->pluck('id'))
                                    ->orWhereNull('project_id')
                                    ->orWhere('project_id', $this->ownerRecord->project_id)
                                    ->pluck('name', 'id')
                            )
                            ->afterStateUpdated(function ($state, Forms\Set $set) {
                                $set('price', Product::findOrFail($state)?->default_price); // @phpstan-ignore-line
                                $set('token_price', Product::findOrFail($state)?->default_price / $this->ownerRecord->project->token_price); // @phpstan-ignore-line
                            })
                            ->searchable()
                            ->preload()
                            ->required(),


When using Octane I get all results, but when not using octane the query is right. How can this be possible and what could I do about this? I am talking about the options query.
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

Laravel Octane and Filament
FilamentFFilament / ❓┊help
2y ago
It's possible use Laravel Octane with Filamentphp?
FilamentFFilament / ❓┊help
3y ago
Laravel octane in production disables SPA Mode
FilamentFFilament / ❓┊help
3mo ago
500 error on FilamentPHP panel after installing Laravel Octane
FilamentFFilament / ❓┊help
11mo ago