2019-02-13 16:36:47 -05:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Models;
|
|
|
|
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
|
2022-08-07 13:37:33 -04:00
|
|
|
class Vehicles extends Model
|
2019-02-13 16:36:47 -05:00
|
|
|
{
|
2022-08-07 13:34:06 -04:00
|
|
|
protected $table = 'vehicles';
|
|
|
|
|
2022-08-14 19:14:58 -04:00
|
|
|
protected $casts = [
|
|
|
|
'owner' => 'integer'
|
|
|
|
];
|
|
|
|
|
2022-08-07 13:34:06 -04:00
|
|
|
protected $fillable = [
|
|
|
|
'year',
|
|
|
|
'make',
|
|
|
|
'model',
|
|
|
|
'type',
|
|
|
|
'doNotJudge',
|
|
|
|
'owner'
|
|
|
|
];
|
|
|
|
|
|
|
|
protected $dates = [
|
|
|
|
'created_at',
|
|
|
|
'updated_at'
|
|
|
|
];
|
|
|
|
|
|
|
|
public function vehicleType()
|
|
|
|
{
|
2022-08-08 15:01:38 -04:00
|
|
|
return $this->belongsTo(CarShowCategory::class, 'type', 'id');
|
2022-08-07 13:34:06 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
public function vehicleOwner()
|
|
|
|
{
|
2022-08-08 15:01:38 -04:00
|
|
|
return $this->belongsTo(Bidders::class, 'owner', 'bidder_assigned_number');
|
2022-08-07 13:34:06 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
public function vehicleScores()
|
|
|
|
{
|
2022-08-28 15:10:17 -04:00
|
|
|
return $this->hasMany(VehicleScores::class, 'vehicle');
|
2022-08-07 13:34:06 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
public function CarShowWinner()
|
|
|
|
{
|
2022-08-08 15:01:38 -04:00
|
|
|
return $this->belongsTo(CarShowWinner::class, 'vehicle');
|
2022-08-07 13:34:06 -04:00
|
|
|
}
|
2019-02-13 16:36:47 -05:00
|
|
|
}
|