vehicle scores setup
This commit is contained in:
parent
012a95bc36
commit
9bc97078fc
@ -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,
|
||||
];
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user