2019-07-11 20:55:45 -04:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Models;
|
|
|
|
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
|
|
|
|
class CarShowCategory extends Model
|
|
|
|
{
|
|
|
|
protected $table = 'car_show_categories';
|
2022-08-06 15:50:07 -04:00
|
|
|
protected static ?string $recordTitleAttribute = 'category_name';
|
|
|
|
|
2022-08-06 16:24:05 -04:00
|
|
|
protected $casts = [
|
|
|
|
'vehicle_type' => 'boolean',
|
|
|
|
];
|
|
|
|
|
2019-07-11 20:55:45 -04:00
|
|
|
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');
|
|
|
|
}
|
|
|
|
}
|