Fix formatting and interfaces in nearly every file
This commit is contained in:
@@ -9,7 +9,7 @@ class Acars extends Resource
|
||||
/**
|
||||
* Transform the resource into an array.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return array
|
||||
*/
|
||||
public function toArray($request)
|
||||
|
||||
@@ -9,12 +9,12 @@ class Airline extends Resource
|
||||
public function toArray($request)
|
||||
{
|
||||
return [
|
||||
'id' => $this->id,
|
||||
'icao' => $this->icao,
|
||||
'iata' => $this->iata,
|
||||
'name' => $this->name,
|
||||
'id' => $this->id,
|
||||
'icao' => $this->icao,
|
||||
'iata' => $this->iata,
|
||||
'name' => $this->name,
|
||||
'country' => $this->country,
|
||||
'logo' => $this->logo,
|
||||
'logo' => $this->logo,
|
||||
#'active' => $this->active,
|
||||
#'created_at' => $this->created_at,
|
||||
#'updated_at' => $this->updated_at,
|
||||
|
||||
@@ -9,10 +9,10 @@ class Award extends Resource
|
||||
public function toArray($request)
|
||||
{
|
||||
return [
|
||||
'id' => $this->id,
|
||||
'title' => $this->title,
|
||||
'id' => $this->id,
|
||||
'title' => $this->title,
|
||||
'description' => $this->description,
|
||||
'image' => $this->image,
|
||||
'image' => $this->image,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ class Flight extends Resource
|
||||
$flight = parent::toArray($request);
|
||||
|
||||
// Return multiple measures so the client can pick what they want
|
||||
if($this->distance instanceof Distance) {
|
||||
if ($this->distance instanceof Distance) {
|
||||
$flight['distance'] = $this->distance->toObject();
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ class JournalTransaction extends Resource
|
||||
public function toArray($request)
|
||||
{
|
||||
$transaction = parent::toArray($request);
|
||||
|
||||
return $transaction;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ class Pirep extends Resource
|
||||
/**
|
||||
* Transform the resource into an array.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return array
|
||||
*/
|
||||
public function toArray($request)
|
||||
@@ -40,8 +40,8 @@ class Pirep extends Resource
|
||||
$pirep['position'] = new Acars($this->position);
|
||||
$pirep['comments'] = PirepComment::collection($this->comments);
|
||||
$pirep['user'] = [
|
||||
'id' => $this->user->id,
|
||||
'name' => $this->user->name,
|
||||
'id' => $this->user->id,
|
||||
'name' => $this->user->name,
|
||||
'home_airport_id' => $this->user->home_airport_id,
|
||||
'curr_airport_id' => $this->user->curr_airport_id,
|
||||
];
|
||||
|
||||
@@ -14,7 +14,7 @@ class PirepComment extends Resource
|
||||
/**
|
||||
* Transform the resource into an array.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return array
|
||||
*/
|
||||
public function toArray($request)
|
||||
@@ -22,13 +22,13 @@ class PirepComment extends Resource
|
||||
$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,
|
||||
'id' => $this->id,
|
||||
'comment' => $this->comment,
|
||||
'created_at' => $this->created_at,
|
||||
'user' => [
|
||||
'id' => $user->id,
|
||||
'pilot_id' => $user->pilot_id,
|
||||
'name' => $user->name,
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ class Rank extends Resource
|
||||
public function toArray($request)
|
||||
{
|
||||
return [
|
||||
'name' => $this->name,
|
||||
'name' => $this->name,
|
||||
'subfleets' => Subfleet::collection($this->subfleets),
|
||||
];
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ class Response extends Resource
|
||||
/**
|
||||
* Transform the resource into an array.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return array
|
||||
*/
|
||||
public function toArray($request)
|
||||
|
||||
@@ -9,12 +9,12 @@ class Setting extends Resource
|
||||
public function toArray($request)
|
||||
{
|
||||
return [
|
||||
'id' => $this->id,
|
||||
'type' => $this->type,
|
||||
'name' => $this->name,
|
||||
'value' => $this->value,
|
||||
'group' => $this->group,
|
||||
'order' => $this->order,
|
||||
'id' => $this->id,
|
||||
'type' => $this->type,
|
||||
'name' => $this->name,
|
||||
'value' => $this->value,
|
||||
'group' => $this->group,
|
||||
'order' => $this->order,
|
||||
'description' => $this->description,
|
||||
];
|
||||
}
|
||||
|
||||
@@ -9,25 +9,25 @@ class User extends Resource
|
||||
public function toArray($request)
|
||||
{
|
||||
return [
|
||||
'id' => $this->id,
|
||||
'pilot_id' => $this->pilot_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,
|
||||
'id' => $this->id,
|
||||
'pilot_id' => $this->pilot_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,
|
||||
'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),
|
||||
'bids' => UserBid::collection($this->bids),
|
||||
'rank' => Rank::make($this->rank),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,10 +9,10 @@ class UserBid extends Resource
|
||||
public function toArray($request)
|
||||
{
|
||||
return [
|
||||
'id' => $this->id,
|
||||
'user_id' => $this->user_id,
|
||||
'id' => $this->id,
|
||||
'user_id' => $this->user_id,
|
||||
'flight_id' => $this->flight_id,
|
||||
'flight' => Flight::collection($this->whenLoaded('flight'))
|
||||
'flight' => Flight::collection($this->whenLoaded('flight'))
|
||||
#'created_at' => $this->created_at,
|
||||
#'updated_at' => $this->updated_at,
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user