updates to add show judging

This commit is contained in:
2019-07-11 20:55:45 -04:00
parent 7cdea664e1
commit c2aced484d
34 changed files with 2341 additions and 318 deletions

View File

@ -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');
}
}

View 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');
}
}

View 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
View 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');
}
}

View 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');
}
}

View File

@ -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'
];
}

View 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');
}
}

View File

@ -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');
}
}