diff --git a/app/Models/Bidders.php b/app/Models/Bidders.php new file mode 100644 index 0000000..35f6377 --- /dev/null +++ b/app/Models/Bidders.php @@ -0,0 +1,31 @@ +hasMany('App\Models\Checkout', 'bidder_num', 'idbidders'); + } + + public function winningBids() + { + return $this->hasMany('App\Models\WinningBids', 'winning_bidder_num', 'idbidders'); + } +} diff --git a/app/Models/Checkout.php b/app/Models/Checkout.php new file mode 100644 index 0000000..72516c8 --- /dev/null +++ b/app/Models/Checkout.php @@ -0,0 +1,28 @@ +belongsTo('App\Models\Bidders', 'bidder_num', 'idbidders'); + } + + public function paymentMethod() + { + return $this->hasMany('App\Models\PaymentMethods', 'payment_method', 'pm_id'); + } +} diff --git a/app/Models/Items.php b/app/Models/Items.php new file mode 100644 index 0000000..24a4769 --- /dev/null +++ b/app/Models/Items.php @@ -0,0 +1,21 @@ +belongsTo('App\Models\WinningBids', 'winning_item_num', 'iditems'); + } +} diff --git a/app/Models/PaymentMethods.php b/app/Models/PaymentMethods.php new file mode 100644 index 0000000..42f489c --- /dev/null +++ b/app/Models/PaymentMethods.php @@ -0,0 +1,19 @@ +belongsTo('App\Models\Checkout', 'payment_method', 'pm_id'); + } + +} diff --git a/app/Models/WinningBids.php b/app/Models/WinningBids.php new file mode 100644 index 0000000..d5819c1 --- /dev/null +++ b/app/Models/WinningBids.php @@ -0,0 +1,25 @@ +hasMany('App\Models\Items', 'winning_item_num', 'iditems'); + } + + public function bidders() + { + return $this->belongsTo('App\Models\Bidders', 'winning_bidder_num', 'idbidders'); + } +}