phpvms/app/Models/Navdata.php
Nabeel S 12848091a2
Laravel 9 Update (#1413)
Update to Laravel 9 and PHP 8+

Co-authored-by: B.Fatih KOZ <fatih.koz@gmail.com>
2022-03-14 11:45:18 -04:00

49 lines
844 B
PHP

<?php
namespace App\Models;
use App\Contracts\Model;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Factories\HasFactory;
class Navdata extends Model
{
use HasFactory;
public $table = 'navdata';
protected $keyType = 'string';
public $timestamps = false;
public $incrementing = false;
protected $fillable = [
'id',
'name',
'type',
'lat',
'lon',
'freq',
];
protected $casts = [
'type' => 'integer',
'lat' => 'float',
'lon' => 'float',
'freq' => 'float',
];
/**
* Make sure the ID is in all caps
*
* @return Attribute
*/
public function id(): Attribute
{
return Attribute::make(
set: fn ($id) => strtoupper($id)
);
}
}