2018-02-21 02:06:52 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Http\Resources;
|
|
|
|
|
2020-03-23 21:31:35 +08:00
|
|
|
use App\Contracts\Resource;
|
2018-02-21 02:06:52 +08:00
|
|
|
use App\Models\Enums\NavaidType;
|
|
|
|
|
|
|
|
class Navdata extends Resource
|
|
|
|
{
|
|
|
|
public function toArray($request)
|
|
|
|
{
|
2019-07-16 03:14:40 +08:00
|
|
|
$res = parent::toArray($request);
|
2018-02-21 02:06:52 +08:00
|
|
|
|
|
|
|
// Some details about the navaid type
|
|
|
|
$type = [
|
2019-07-16 03:14:40 +08:00
|
|
|
'type' => $res['type'],
|
|
|
|
'name' => NavaidType::label($res['type']),
|
2018-02-21 02:06:52 +08:00
|
|
|
];
|
|
|
|
|
2019-07-16 03:14:40 +08:00
|
|
|
$res['type'] = $type;
|
2018-02-21 02:06:52 +08:00
|
|
|
|
2019-07-16 03:14:40 +08:00
|
|
|
return $res;
|
2018-02-21 02:06:52 +08:00
|
|
|
}
|
|
|
|
}
|