Don't return bids by default, fix user flight column #639 (#640)

Fix the user api response, don't return bids by default, fix flights column #639
This commit is contained in:
Nabeel S
2020-03-25 18:04:26 -04:00
committed by GitHub
parent 88e8ea6ed1
commit f3fe3a56ba
7 changed files with 30 additions and 25 deletions

View File

@@ -4,17 +4,20 @@ namespace App\Http\Resources;
use App\Contracts\Resource;
/**
* @mixin \App\Models\Bid
*/
class UserBid extends Resource
{
public function toArray($request)
{
return [
'id' => $this->id,
'user_id' => $this->user_id,
'flight_id' => $this->flight_id,
'flights' => Flight::collection($this->whenLoaded('flight')),
//'created_at' => $this->created_at,
//'updated_at' => $this->updated_at,
'id' => $this->id,
'user_id' => $this->user_id,
'flight_id' => $this->flight_id,
'created_at' => $this->created_at,
'updated_at' => $this->updated_at,
'flight' => new Flight($this->whenLoaded('flight')),
];
}
}