diff --git a/app/Filament/Resources/VehicleScoresResource.php b/app/Filament/Resources/VehicleScoresResource.php index 81827bd..2ca5f87 100644 --- a/app/Filament/Resources/VehicleScoresResource.php +++ b/app/Filament/Resources/VehicleScoresResource.php @@ -36,7 +36,7 @@ class VehicleScoresResource extends Resource ->searchable(), Select::make('vehicle') ->label('Vehicle') - ->options(Vehicles::all()->pluck('owner', 'id')) + ->options(Vehicles::all()->pluck('owner', 'owner')) ->searchable(), TextInput::make('overall_score') ->label('Overall Score'), diff --git a/app/Models/VehicleScores.php b/app/Models/VehicleScores.php index b6df6b5..1049fab 100644 --- a/app/Models/VehicleScores.php +++ b/app/Models/VehicleScores.php @@ -22,11 +22,11 @@ class VehicleScores extends Model public function judge() { - return $this->belongsTo(Judges::class, 'judge'); + return $this->belongsTo(Judges::class, 'judge', 'id'); } public function scoredVehicle() { - return $this->hasMany(Vehicles::class, 'owner'); + return $this->hasMany('App\Models\Vehicles', 'owner', 'vehicle'); } }