44 lines
778 B
PHP
44 lines
778 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 $dates = [
|
|
'created_at',
|
|
'updated_at'
|
|
];
|
|
|
|
public function vehicleType()
|
|
{
|
|
return $this->belongsTo('App\Models\CarShowCategory', 'type', 'id');
|
|
}
|
|
|
|
public function vehicleOwner()
|
|
{
|
|
return $this->belongsTo('App\Models\Bidders', 'owner', 'bidder_assigned_number');
|
|
}
|
|
|
|
public function vehicleScores()
|
|
{
|
|
return $this->hasMany('App\Models\VechicleScores', 'id', 'vehicle');
|
|
}
|
|
|
|
public function CarShowWinner()
|
|
{
|
|
return $this->belongsTo('App\Models\CarShowWinner', 'id', 'vehicle');
|
|
}
|
|
}
|