UnitFinancialResource.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. namespace App\Http\Resources;
  3. use Carbon\Carbon;
  4. use Illuminate\Http\Request;
  5. use Illuminate\Http\Resources\Json\JsonResource;
  6. use App\Models\UnitFinancial;
  7. class UnitFinancialResource extends JsonResource
  8. {
  9. public function toArray(Request $request): array
  10. {
  11. return [
  12. 'id' => $this->id,
  13. 'unit_id' => $this->unit_id,
  14. 'tax_regime' => $this->tax_regime,
  15. 'bank' => $this->bank,
  16. 'agency' => $this->agency,
  17. 'account' => $this->account,
  18. 'account_type' => $this->account_type,
  19. 'account_holder' => $this->account_holder,
  20. 'pix_key' => $this->pix_key,
  21. 'billing_method' => $this->billing_method,
  22. 'due_date' => $this->due_date,
  23. 'financial_email' => $this->financial_email,
  24. 'group' => $this->group,
  25. 'maintenance_fee' => $this->maintenance_fee,
  26. 'marketing_fund' => $this->marketing_fund,
  27. 'tbr' => $this->tbr,
  28. 'created_at' => Carbon::parse($this->created_at)->format('Y-m-d H:i:s'),
  29. 'updated_at' => Carbon::parse($this->updated_at)->format('Y-m-d H:i:s'),
  30. ];
  31. }
  32. }