silent-auction/app/Models/CarShowCategory.php
2022-08-08 14:54:16 -04:00

35 lines
630 B
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class CarShowCategory extends Model
{
protected $table = 'car_show_categories';
protected static ?string $recordTitleAttribute = 'category_name';
protected $casts = [
'vehicle_type' => 'boolean',
];
protected $fillable = [
'category_name',
'vehicle_type'
];
protected $dates = [
'created_at',
'updated_at'
];
public function vehicle()
{
return $this->hasMany(App\Models\Vehicles::class, 'type');
}
public function showWinner()
{
return $this->hasMany('App\Models\CarShowWinner', 'id', 'category');
}
}