Files
.well-known
app
Console
Exceptions
Filament
Helpers
Http
Models
Bidders.php
CarShowCategory.php
CarShowWinner.php
Checkout.php
Items.php
Judges.php
PaymentMethods.php
PeoplesChoice.php
VehicleScores.php
Vehicles.php
WinningBids.php
Providers
User.php
bootstrap
config
database
public
resources
routes
stats
storage
tests
.env.example
.ftpconfig
.gitattributes
.gitignore
.htaccess.bak
artisan
composer.json
composer.lock
composer.lock.bak
package.json
phpunit.xml
readme.md
server.php
webpack.mix.js
silent-auction/app/Models/Vehicles.php
2022-08-28 15:10:17 -04:00

49 lines
862 B
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Vehicles extends Model
{
protected $table = 'vehicles';
protected $casts = [
'owner' => 'integer'
];
protected $fillable = [
'year',
'make',
'model',
'type',
'doNotJudge',
'owner'
];
protected $dates = [
'created_at',
'updated_at'
];
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');
}
}