diff --git a/app/Filament/User/Resources/ProductResource/Pages/RecipeHistory.php b/app/Filament/User/Resources/ProductResource/Pages/RecipeHistory.php index b41604d..00ab36c 100644 --- a/app/Filament/User/Resources/ProductResource/Pages/RecipeHistory.php +++ b/app/Filament/User/Resources/ProductResource/Pages/RecipeHistory.php @@ -45,21 +45,18 @@ class RecipeHistory extends Page implements HasTable public function table(Table $table): Table { - $currentRecipeId = $this->record->recipes_id; - return $table - ->query( - Recipe::query() - ->where('product_id', $this->record->id) - ->with('spices') - ->orderByDesc('version') + ->query(fn () => Recipe::query() + ->where('product_id', $this->record->id) + ->with('spices') + ->orderByDesc('version') ) ->columns([ TextColumn::make('version') ->label('Version') ->formatStateUsing(fn ($state) => 'v' . $state) ->badge() - ->color(fn (Recipe $recipe) => $recipe->id === $currentRecipeId ? 'success' : 'gray'), + ->color(fn (Recipe $recipe) => $recipe->id === $this->record->recipes_id ? 'success' : 'gray'), TextColumn::make('spices_summary') ->label('Zutaten') ->state(fn (Recipe $recipe) =>