From 9bc97078fc44bb1d30ea372da13112f9199ab35c Mon Sep 17 00:00:00 2001 From: Russ Long Date: Mon, 8 Aug 2022 20:56:28 -0400 Subject: [PATCH] vehicle scores setup --- .../Resources/VehicleScoresResource.php | 24 +++++++++++++++---- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/app/Filament/Resources/VehicleScoresResource.php b/app/Filament/Resources/VehicleScoresResource.php index d94863d..8170886 100644 --- a/app/Filament/Resources/VehicleScoresResource.php +++ b/app/Filament/Resources/VehicleScoresResource.php @@ -12,10 +12,11 @@ use Filament\Resources\Table; use Filament\Tables; use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\SoftDeletingScope; -use Filament\Tables\Columns\BooleanColumn; use Filament\Tables\Columns\TextColumn; use Filament\Forms\Components\TextInput; -use Filament\Forms\Components\Toggle; +use Filament\Forms\Components\Select; +use App\Models\Vehicles; +use App\Models\Judges; class VehicleScoresResource extends Resource { @@ -29,7 +30,17 @@ class VehicleScoresResource extends Resource { return $form ->schema([ - // + Select::make('judge') + ->label('Judge') + ->options(Judges::all()->pluck('judge_number', 'id')) + ->searchable(), + Select::make('vehicle') + ->label('Vehicle') + ->options(Vehicles::all()->pluck('owner', 'id')) + ->searchable(), + TextInput::make('overall_score') + ->label('Overall Score'), + ]); } @@ -37,7 +48,9 @@ class VehicleScoresResource extends Resource { return $table ->columns([ - // + TextColumn::make('judges.judge_number')->label('Judge'), + TextColumn::make('scoredVehicle.owner')->label('Vehicle Number'), + TextColumn::make('overall_score')->label('Score'), ]) ->filters([ // @@ -53,7 +66,8 @@ class VehicleScoresResource extends Resource public static function getRelations(): array { return [ - // + RelationManagers\JudgeRelationManager::class, + RelationManagers\ScoredVehicleRelationManager::class, ]; }