You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

JournalEntryCast.php 531B

1234567891011121314151617181920212223
  1. <?php
  2. namespace App\Casts;
  3. use Illuminate\Contracts\Database\Eloquent\CastsAttributes;
  4. use Illuminate\Database\Eloquent\Model;
  5. use UnexpectedValueException;
  6. class JournalEntryCast implements CastsAttributes
  7. {
  8. public function get(Model $model, string $key, mixed $value, array $attributes): int
  9. {
  10. return (int) $value;
  11. }
  12. /**
  13. * @throws UnexpectedValueException
  14. */
  15. public function set(Model $model, string $key, mixed $value, array $attributes): int
  16. {
  17. return (int) $value;
  18. }
  19. }