Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

AccountBalanceDTO.php 970B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. namespace App\DTO;
  3. use Livewire\Wireable;
  4. class AccountBalanceDTO implements Wireable
  5. {
  6. public function __construct(
  7. public ?string $startingBalance,
  8. public ?string $debitBalance,
  9. public ?string $creditBalance,
  10. public ?string $netMovement,
  11. public ?string $endingBalance,
  12. ) {}
  13. public function toLivewire(): array
  14. {
  15. return [
  16. 'startingBalance' => $this->startingBalance,
  17. 'debitBalance' => $this->debitBalance,
  18. 'creditBalance' => $this->creditBalance,
  19. 'netMovement' => $this->netMovement,
  20. 'endingBalance' => $this->endingBalance,
  21. ];
  22. }
  23. public static function fromLivewire($value): static
  24. {
  25. return new static(
  26. $value['startingBalance'],
  27. $value['debitBalance'],
  28. $value['creditBalance'],
  29. $value['netMovement'],
  30. $value['endingBalance'],
  31. );
  32. }
  33. }