2017-12-21 06:34:52 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Models;
|
|
|
|
|
2019-07-16 03:44:31 +08:00
|
|
|
use App\Contracts\Model;
|
2018-03-20 09:50:40 +08:00
|
|
|
|
|
|
|
class Navdata extends Model
|
2017-12-21 06:34:52 +08:00
|
|
|
{
|
|
|
|
public $table = 'navdata';
|
2018-03-21 08:40:19 +08:00
|
|
|
|
2019-09-13 20:05:02 +08:00
|
|
|
protected $keyType = 'string';
|
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
|
|
|
}
|