2017-12-21 06:34:52 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Models;
|
|
|
|
|
2018-03-20 09:50:40 +08:00
|
|
|
use App\Interfaces\Model;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Class Navdata
|
|
|
|
*/
|
|
|
|
class Navdata extends Model
|
2017-12-21 06:34:52 +08:00
|
|
|
{
|
|
|
|
public $table = 'navdata';
|
2018-03-21 08:40:19 +08:00
|
|
|
|
2017-12-21 06:34:52 +08:00
|
|
|
public $timestamps = false;
|
|
|
|
public $incrementing = false;
|
|
|
|
|
2018-03-21 08:40:19 +08:00
|
|
|
protected $fillable = [
|
2017-12-21 06:34:52 +08:00
|
|
|
'id',
|
|
|
|
'name',
|
|
|
|
'type',
|
|
|
|
'lat',
|
|
|
|
'lon',
|
|
|
|
'freq',
|
|
|
|
];
|
|
|
|
|
2018-03-21 08:40:19 +08:00
|
|
|
protected $casts = [
|
2018-03-20 09:50:40 +08:00
|
|
|
'type' => 'integer',
|
|
|
|
'lat' => 'float',
|
|
|
|
'lon' => 'float',
|
|
|
|
'freq' => 'float',
|
2017-12-21 06:34:52 +08:00
|
|
|
];
|
2018-01-02 03:48:02 +08:00
|
|
|
|
2018-03-19 09:37:35 +08:00
|
|
|
/**
|
|
|
|
* Make sure the ID is in all caps
|
2018-08-27 00:40:04 +08:00
|
|
|
*
|
2018-03-19 09:37:35 +08:00
|
|
|
* @param $id
|
|
|
|
*/
|
|
|
|
public function setIdAttribute($id): void
|
2018-01-02 03:48:02 +08:00
|
|
|
{
|
2018-03-19 09:37:35 +08:00
|
|
|
$this->attributes['id'] = strtoupper($id);
|
2018-01-02 03:48:02 +08:00
|
|
|
}
|
2017-12-21 06:34:52 +08:00
|
|
|
}
|