This commit is contained in:
hackerESQ
2025-01-24 19:24:16 -06:00
parent b9d41f9ac0
commit 6d9e0008b8
11 changed files with 137 additions and 223 deletions
+16 -1
View File
@@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace App\Http\Resources;
use Illuminate\Http\Request;
@@ -14,6 +16,19 @@ class TransactionResource extends JsonResource
*/
public function toArray(Request $request): array
{
return parent::toArray($request);
return [
'id' => $this->id,
'symbol' => $this->symbol,
'portfolio_id' => $this->portfolio_id,
'transaction_type' => $this->transaction_type,
'quantity' => $this->quantity,
'cost_basis' => $this->cost_basis,
'sale_price' => $this->sale_price,
'split' => $this->split,
'reinvested_dividend' => $this->reinvested_dividend,
'date' => $this->date,
'created_at' => $this->created_at,
'updated_at' => $this->updated_at,
];
}
}