silent-auction/app/Models/Vehicles.php

44 lines
778 B
PHP
Raw Normal View History

2019-02-13 16:36:47 -05:00
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class vehicles extends Model
{
2019-07-11 20:55:45 -04:00
protected $table = 'vehicles';
2019-02-13 16:36:47 -05:00
protected $fillable = [
'year',
'make',
'model',
'type',
'doNotJudge',
'owner'
];
protected $dates = [
'created_at',
'updated_at'
];
2019-07-11 20:55:45 -04:00
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');
}
2019-02-13 16:36:47 -05:00
}