scores relations

This commit is contained in:
Russ Long 2022-08-08 21:11:30 -04:00
parent 78c72d1937
commit 484e2c23ec
2 changed files with 3 additions and 3 deletions

View File

@ -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'),

View File

@ -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');
}
}