phpvms/app/Http/Resources/User.php
2017-12-30 13:39:23 -06:00

33 lines
947 B
PHP

<?php
namespace App\Http\Resources;
use Illuminate\Http\Resources\Json\Resource;
class User extends Resource
{
public function toArray($request)
{
return [
'id' => $this->id,
'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,
'last_pirep_id' => $this->last_pirep_id,
'flights' => $this->flight,
'flight_time' => $this->flight_time,
'balance' => $this->balance,
'timezone' => $this->timezone,
'status' => $this->status,
'state' => $this->state,
'airline' => Airline::make($this->airline),
'bids' => UserBid::collection($this->bids),
'rank' => Rank::make($this->rank),
];
}
}