Return the flight object with the bid
This commit is contained in:
16
app/Http/Resources/Bid.php
Normal file
16
app/Http/Resources/Bid.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Resources;
|
||||
|
||||
use Illuminate\Http\Resources\Json\Resource;
|
||||
|
||||
class Bid extends Resource
|
||||
{
|
||||
public function toArray($request)
|
||||
{
|
||||
$bid = parent::toArray($request);
|
||||
$bid['flight'] = new Flight($this->flight);
|
||||
|
||||
return $bid;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user