silent-auction/app/Models/WinningBids.php
2022-09-04 13:57:38 -04:00

36 lines
646 B
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class WinningBids extends Model
{
protected $table = 'winning_bids';
protected $primaryKey = 'idwinning_bids';
protected $fillable = [
'winning_bidder_num',
'winning_cost',
'winning_item_num',
'created_at',
'updated_at'
];
protected $dates = [
'created_at',
'updated_at'
];
public function items()
{
return $this->hasMany(Items::class, 'iditems', 'winning_item_num');
}
public function bidders()
{
return $this->belongsTo(Bidders::class, 'winning_bidder_num', 'idbidders');
}
}