Files
silent-auction/app/Models/Vehicles.php
T
2026-04-20 12:56:52 -04:00

49 lines
925 B
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Vehicles extends Model
{
protected $table = 'vehicles';
protected $fillable = [
'year',
'make',
'model',
'type',
'doNotJudge',
'owner'
];
protected function casts(): array
{
return [
'owner' => 'integer',
'created_at' => 'datetime',
'updated_at' => 'datetime',
];
}
public function vehicleType()
{
return $this->belongsTo(CarShowCategory::class, 'type', 'id');
}
public function vehicleOwner()
{
return $this->belongsTo(Bidders::class, 'owner', 'bidder_assigned_number');
}
public function vehicleScores()
{
return $this->hasMany(VehicleScores::class, 'vehicle');
}
public function CarShowWinner()
{
return $this->belongsTo(CarShowWinner::class, 'vehicle');
}
}