2017-12-13 06:58:27 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Http\Resources;
|
|
|
|
|
|
|
|
use Illuminate\Http\Resources\Json\Resource;
|
|
|
|
|
|
|
|
class User extends Resource
|
|
|
|
{
|
|
|
|
public function toArray($request)
|
|
|
|
{
|
|
|
|
return [
|
2018-03-20 09:50:40 +08:00
|
|
|
'id' => $this->id,
|
|
|
|
'pilot_id' => $this->pilot_id,
|
2019-07-17 01:54:14 +08:00
|
|
|
'ident' => $this->ident,
|
2018-03-20 09:50:40 +08:00
|
|
|
'name' => $this->name,
|
|
|
|
'email' => $this->email,
|
|
|
|
'apikey' => $this->apikey,
|
|
|
|
'rank_id' => $this->rank_id,
|
|
|
|
'home_airport' => $this->home_airport_id,
|
|
|
|
'curr_airport' => $this->curr_airport_id,
|
2017-12-13 06:58:27 +08:00
|
|
|
'last_pirep_id' => $this->last_pirep_id,
|
2018-03-20 09:50:40 +08:00
|
|
|
'flights' => $this->flight,
|
|
|
|
'flight_time' => $this->flight_time,
|
|
|
|
'balance' => $this->balance,
|
|
|
|
'timezone' => $this->timezone,
|
|
|
|
'status' => $this->status,
|
|
|
|
'state' => $this->state,
|
2017-12-13 06:58:27 +08:00
|
|
|
|
|
|
|
'airline' => Airline::make($this->airline),
|
2018-03-20 09:50:40 +08:00
|
|
|
'bids' => UserBid::collection($this->bids),
|
|
|
|
'rank' => Rank::make($this->rank),
|
2017-12-13 06:58:27 +08:00
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|