create models
This commit is contained in:
parent
90cebee2fa
commit
56c9a45c33
31
app/Models/Bidders.php
Normal file
31
app/Models/Bidders.php
Normal file
@ -0,0 +1,31 @@
|
||||
<?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',
|
||||
'bidder_assigned_number'
|
||||
];
|
||||
|
||||
public function checkout()
|
||||
{
|
||||
return $this->hasMany('App\Models\Checkout', 'bidder_num', 'idbidders');
|
||||
}
|
||||
|
||||
public function winningBids()
|
||||
{
|
||||
return $this->hasMany('App\Models\WinningBids', 'winning_bidder_num', 'idbidders');
|
||||
}
|
||||
}
|
28
app/Models/Checkout.php
Normal file
28
app/Models/Checkout.php
Normal file
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Checkout extends Model
|
||||
{
|
||||
protected $table = 'checkout';
|
||||
protected $fillable = [
|
||||
'bidder_num',
|
||||
'winnertotal',
|
||||
'payment_method',
|
||||
'check_number',
|
||||
'cc_transaction',
|
||||
'cc_amount'
|
||||
];
|
||||
|
||||
public function bidder()
|
||||
{
|
||||
return $this->belongsTo('App\Models\Bidders', 'bidder_num', 'idbidders');
|
||||
}
|
||||
|
||||
public function paymentMethod()
|
||||
{
|
||||
return $this->hasMany('App\Models\PaymentMethods', 'payment_method', 'pm_id');
|
||||
}
|
||||
}
|
21
app/Models/Items.php
Normal file
21
app/Models/Items.php
Normal file
@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Items extends Model
|
||||
{
|
||||
protected $table = 'items';
|
||||
protected $fillable = [
|
||||
'item_desc',
|
||||
'item_min_bid',
|
||||
'item_est_value',
|
||||
'item_assigned_num'
|
||||
];
|
||||
|
||||
public function winningBids()
|
||||
{
|
||||
return $this->belongsTo('App\Models\WinningBids', 'winning_item_num', 'iditems');
|
||||
}
|
||||
}
|
19
app/Models/PaymentMethods.php
Normal file
19
app/Models/PaymentMethods.php
Normal file
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class PaymentMethods extends Model
|
||||
{
|
||||
protected $table = 'payment_methods';
|
||||
protected $fillable = [
|
||||
'pm_name'
|
||||
];
|
||||
|
||||
public function checkout()
|
||||
{
|
||||
return $this->belongsTo('App\Models\Checkout', 'payment_method', 'pm_id');
|
||||
}
|
||||
|
||||
}
|
25
app/Models/WinningBids.php
Normal file
25
app/Models/WinningBids.php
Normal file
@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class WinningBids extends Model
|
||||
{
|
||||
protected $table = 'winning_bids';
|
||||
protected $fillable = [
|
||||
'winning_bidder_num',
|
||||
'winning_cost',
|
||||
'winning_item_num'
|
||||
];
|
||||
|
||||
public function items()
|
||||
{
|
||||
return $this->hasMany('App\Models\Items', 'winning_item_num', 'iditems');
|
||||
}
|
||||
|
||||
public function bidders()
|
||||
{
|
||||
return $this->belongsTo('App\Models\Bidders', 'winning_bidder_num', 'idbidders');
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user