Add pirep comments and subfleets fares #118

This commit is contained in:
Nabeel Shahzad
2018-01-23 21:40:34 -06:00
parent f9efa81bb4
commit 9964eb63fb
9 changed files with 191 additions and 72 deletions

View File

@@ -0,0 +1,35 @@
<?php
namespace App\Http\Resources;
use Illuminate\Http\Resources\Json\Resource;
/**
* Class Response
* @package App\Http\Resources
* Generic response resource
*/
class PirepComment extends Resource
{
/**
* Transform the resource into an array.
*
* @param \Illuminate\Http\Request $request
* @return array
*/
public function toArray($request)
{
$user = $this->user;
return [
'id' => $this->id,
'comment' => $this->comment,
'created_at' => $this->created_at,
'user' => [
'id' => $user->id,
'pilot_id' => $user->pilot_id,
'name' => $user->name,
],
];
}
}