2017-12-13 06:58:27 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Http\Resources;
|
|
|
|
|
2020-03-23 21:31:35 +08:00
|
|
|
use App\Contracts\Resource;
|
2017-12-13 06:58:27 +08:00
|
|
|
|
2020-03-26 06:04:26 +08:00
|
|
|
/**
|
|
|
|
* @mixin \App\Models\Bid
|
|
|
|
*/
|
2017-12-13 06:58:27 +08:00
|
|
|
class UserBid extends Resource
|
|
|
|
{
|
|
|
|
public function toArray($request)
|
|
|
|
{
|
|
|
|
return [
|
2020-03-26 06:04:26 +08:00
|
|
|
'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')),
|
2017-12-13 06:58:27 +08:00
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|