2017-12-26 05:19:34 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Http\Resources;
|
|
|
|
|
2019-07-16 03:14:40 +08:00
|
|
|
class Acars extends Response
|
2017-12-26 05:19:34 +08:00
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Transform the resource into an array.
|
|
|
|
*
|
2018-08-27 00:40:04 +08:00
|
|
|
* @param \Illuminate\Http\Request $request
|
|
|
|
*
|
2017-12-26 05:19:34 +08:00
|
|
|
* @return array
|
|
|
|
*/
|
|
|
|
public function toArray($request)
|
|
|
|
{
|
2019-07-16 03:14:40 +08:00
|
|
|
$res = parent::toArray($request);
|
2018-05-04 04:07:16 +08:00
|
|
|
|
2019-07-16 03:14:40 +08:00
|
|
|
$this->checkUnitFields($res, [
|
|
|
|
'distance',
|
|
|
|
'fuel',
|
|
|
|
]);
|
2018-05-04 04:07:16 +08:00
|
|
|
|
2019-07-16 03:14:40 +08:00
|
|
|
return $res;
|
2017-12-26 05:19:34 +08:00
|
|
|
}
|
|
|
|
}
|