updates to add show judging
This commit is contained in:
@ -25,7 +25,7 @@ class Bidders extends Model
|
||||
'created_at',
|
||||
'updated_at'
|
||||
];
|
||||
|
||||
|
||||
public function checkout()
|
||||
{
|
||||
return $this->hasMany('App\Models\Checkout', 'bidder_num', 'idbidders');
|
||||
@ -35,4 +35,9 @@ class Bidders extends Model
|
||||
{
|
||||
return $this->hasMany('App\Models\WinningBids', 'winning_bidder_num', 'idbidders');
|
||||
}
|
||||
|
||||
public function vehicles()
|
||||
{
|
||||
return $this->hasMany('App\Models\Vehicles', 'owner', 'bidder_assigned_number');
|
||||
}
|
||||
}
|
||||
|
28
app/Models/CarShowCategory.php
Normal file
28
app/Models/CarShowCategory.php
Normal file
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class CarShowCategory extends Model
|
||||
{
|
||||
protected $table = 'car_show_categories';
|
||||
protected $fillable = [
|
||||
'category_name',
|
||||
'vehicle_type'
|
||||
];
|
||||
|
||||
protected $dates = [
|
||||
'created_at',
|
||||
'updated_at'
|
||||
];
|
||||
|
||||
public function vehicle()
|
||||
{
|
||||
return $this->hasMany('App\Models\Vehicles', 'id', 'type');
|
||||
}
|
||||
public function showWinner()
|
||||
{
|
||||
return $this->hasMany('App\Models\CarShowWinner', 'id', 'category');
|
||||
}
|
||||
}
|
30
app/Models/CarShowWinner.php
Normal file
30
app/Models/CarShowWinner.php
Normal file
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class CarShowWinner extends Model
|
||||
{
|
||||
protected $table = 'car_show_winners';
|
||||
protected $fillable = [
|
||||
'vehicle',
|
||||
'category',
|
||||
'place'
|
||||
];
|
||||
|
||||
protected $dates = [
|
||||
'created_at',
|
||||
'updated_at'
|
||||
];
|
||||
|
||||
public function awardVehicle()
|
||||
{
|
||||
return $this->hasMany('App\Models\Vehicles', 'id', 'vehicle');
|
||||
}
|
||||
|
||||
public function awardCategory()
|
||||
{
|
||||
return $this->hasMany('App\Models\CarShowCategory', 'id', 'category');
|
||||
}
|
||||
}
|
25
app/Models/Judges.php
Normal file
25
app/Models/Judges.php
Normal file
@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Judges extends Model
|
||||
{
|
||||
protected $table = 'judges';
|
||||
protected $fillable = [
|
||||
'judge_number',
|
||||
'created_at',
|
||||
'updated_at'
|
||||
];
|
||||
|
||||
protected $dates = [
|
||||
'created_at',
|
||||
'updated_at'
|
||||
];
|
||||
|
||||
public function vehicleScores()
|
||||
{
|
||||
return $this->hasMany('App\Models\VehicleScores', 'judge', 'id');
|
||||
}
|
||||
}
|
26
app/Models/PeoplesChoice.php
Normal file
26
app/Models/PeoplesChoice.php
Normal file
@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class PeoplesChoice extends Model
|
||||
{
|
||||
protected $table = 'peoples_choice';
|
||||
protected $fillable = [
|
||||
'vehicle',
|
||||
'pc_count',
|
||||
'created_at',
|
||||
'updated_at'
|
||||
];
|
||||
|
||||
protected $dates = [
|
||||
'created_at',
|
||||
'updated_at'
|
||||
];
|
||||
|
||||
public function vehicles()
|
||||
{
|
||||
return $this->belongsTo('App\Models\Vehicles', 'vehicle', 'id');
|
||||
}
|
||||
}
|
@ -1,18 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Types extends Model
|
||||
{
|
||||
protected $table = 'types';
|
||||
protected $fillable = [
|
||||
'type_name'
|
||||
];
|
||||
|
||||
protected $dates = [
|
||||
'created_at',
|
||||
'updated_at'
|
||||
];
|
||||
}
|
32
app/Models/VehicleScores.php
Normal file
32
app/Models/VehicleScores.php
Normal file
@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class VehicleScores extends Model
|
||||
{
|
||||
protected $table = 'vehicle_scores';
|
||||
protected $fillable = [
|
||||
'judge',
|
||||
'overall_score',
|
||||
'vehicle',
|
||||
'created_at',
|
||||
'updated_at'
|
||||
];
|
||||
|
||||
protected $dates = [
|
||||
'created_at',
|
||||
'updated_at'
|
||||
];
|
||||
|
||||
public function judge()
|
||||
{
|
||||
return $this->belongsTo('App\Models\Judges', 'judge', 'id');
|
||||
}
|
||||
|
||||
public function scoredVehicle()
|
||||
{
|
||||
return $this->hasMany('App\Models\Vehicles', 'id', 'vehicle');
|
||||
}
|
||||
}
|
@ -6,7 +6,7 @@ use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class vehicles extends Model
|
||||
{
|
||||
protected $table = 'items';
|
||||
protected $table = 'vehicles';
|
||||
protected $fillable = [
|
||||
'year',
|
||||
'make',
|
||||
@ -20,4 +20,24 @@ class vehicles extends Model
|
||||
'created_at',
|
||||
'updated_at'
|
||||
];
|
||||
|
||||
public function vehicleType()
|
||||
{
|
||||
return $this->belongsTo('App\Models\CarShowCategory', 'type', 'id');
|
||||
}
|
||||
|
||||
public function vehicleOwner()
|
||||
{
|
||||
return $this->belongsTo('App\Models\Bidders', 'owner', 'bidder_assigned_number');
|
||||
}
|
||||
|
||||
public function vehicleScores()
|
||||
{
|
||||
return $this->hasMany('App\Models\VechicleScores', 'id', 'vehicle');
|
||||
}
|
||||
|
||||
public function CarShowWinner()
|
||||
{
|
||||
return $this->belongsTo('App\Models\CarShowWinner', 'id', 'vehicle');
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user