resource setup

This commit is contained in:
2022-09-04 13:57:38 -04:00
parent 8f95e68e61
commit e484c0df98
10 changed files with 66 additions and 9 deletions

@ -7,6 +7,9 @@ use Illuminate\Database\Eloquent\Model;
class Bidders extends Model
{
protected $table = 'bidders';
protected $primaryKey = 'idbidders';
protected $fillable = [
'bidder_fname',
'bidder_lname',

@ -7,6 +7,9 @@ use Illuminate\Database\Eloquent\Model;
class Checkout extends Model
{
protected $table = 'checkout';
protected $primaryKey = 'checkout_id';
protected $fillable = [
'bidder_num',
'winnertotal',
@ -25,11 +28,11 @@ class Checkout extends Model
public function bidders()
{
return $this->belongsTo(Bidders::class, 'idbidders');
return $this->belongsTo(Bidders::class, 'bidder_num');
}
public function paymentMethod()
{
return $this->hasMany(PaymentMethods::class, 'payment_method', 'pm_id');
return $this->hasMany(PaymentMethods::class, 'pm_id', 'payment_method');
}
}

@ -7,6 +7,9 @@ use Illuminate\Database\Eloquent\Model;
class Items extends Model
{
protected $table = 'items';
protected $primaryKey = 'iditems';
protected $fillable = [
'item_desc',
'item_min_bid',

@ -7,6 +7,9 @@ use Illuminate\Database\Eloquent\Model;
class PaymentMethods extends Model
{
protected $table = 'payment_methods';
protected $primaryKey = 'pm_id';
protected $fillable = [
'pm_name',
'created_at',

@ -7,6 +7,9 @@ use Illuminate\Database\Eloquent\Model;
class WinningBids extends Model
{
protected $table = 'winning_bids';
protected $primaryKey = 'idwinning_bids';
protected $fillable = [
'winning_bidder_num',
'winning_cost',