50 lines
1.1 KiB
PHP
50 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Database\Factories\VehicleClassFactory;
|
|
use Eloquent;
|
|
use Illuminate\Database\Eloquent\Builder;
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Support\Carbon;
|
|
|
|
/**
|
|
* App\Models\VehicleClass
|
|
*
|
|
* @property string $name
|
|
* @method static VehicleClassFactory factory($count = null, $state = [])
|
|
* @method static Builder|VehicleClass newModelQuery()
|
|
* @method static Builder|VehicleClass newQuery()
|
|
* @method static Builder|VehicleClass query()
|
|
* @method static Builder|VehicleClass whereName($value)
|
|
* @mixin Eloquent
|
|
*/
|
|
class VehicleClass extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $primaryKey = 'name';
|
|
protected $table = 'classes';
|
|
public $incrementing = false;
|
|
public $timestamps = false;
|
|
protected $guarded = [];
|
|
|
|
public function getName(): string
|
|
{
|
|
return $this->name;
|
|
}
|
|
|
|
public function setName(string $name): VehicleClass
|
|
{
|
|
$this->name = $name;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function getDisplayName(): string
|
|
{
|
|
return ucwords(str_replace('_', ' ', $this->name));
|
|
}
|
|
}
|