From 56c9a45c33a45d951be04bf275ea328ff39259df Mon Sep 17 00:00:00 2001 From: Russ Long Date: Sun, 23 Dec 2018 09:00:22 -0500 Subject: [PATCH] create models --- app/Models/Bidders.php | 31 +++++++++++++++++++++++++++++++ app/Models/Checkout.php | 28 ++++++++++++++++++++++++++++ app/Models/Items.php | 21 +++++++++++++++++++++ app/Models/PaymentMethods.php | 19 +++++++++++++++++++ app/Models/WinningBids.php | 25 +++++++++++++++++++++++++ 5 files changed, 124 insertions(+) create mode 100644 app/Models/Bidders.php create mode 100644 app/Models/Checkout.php create mode 100644 app/Models/Items.php create mode 100644 app/Models/PaymentMethods.php create mode 100644 app/Models/WinningBids.php 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'); + } +}