silent-auction/app/Models/Bidders.php

44 lines
878 B
PHP
Raw Normal View History

2018-12-23 09:00:22 -05:00
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Bidders extends Model
{
protected $table = 'bidders';
protected $fillable = [
'bidder_fname',
'bidder_lname',
'bidder_addr',
'bidder_city',
'bidder_state',
'bidder_zip',
'bidder_phone',
'bidder_email',
2018-12-23 10:17:10 -05:00
'bidder_assigned_number',
'created_at',
'updated_at'
2018-12-23 09:00:22 -05:00
];
2018-12-23 10:17:10 -05:00
protected $dates = [
'created_at',
'updated_at'
];
2019-07-11 20:55:45 -04:00
2018-12-23 09:00:22 -05:00
public function checkout()
{
2018-12-23 10:26:26 -05:00
return $this->hasMany('App\Models\Checkout', 'bidder_num', 'idbidders');
2018-12-23 09:00:22 -05:00
}
public function winningBids()
{
2018-12-23 10:26:26 -05:00
return $this->hasMany('App\Models\WinningBids', 'winning_bidder_num', 'idbidders');
2018-12-23 09:00:22 -05:00
}
2019-07-11 20:55:45 -04:00
public function vehicles()
{
return $this->hasMany(Vehicles::class, 'owner', 'bidder_assigned_number');
2019-07-11 20:55:45 -04:00
}
2018-12-23 09:00:22 -05:00
}