File manager - Edit - /var/www/html/gop/api/app/Casts/Money.php
Back
<?php namespace App\Casts; use Illuminate\Contracts\Database\Eloquent\CastsAttributes; class Money implements CastsAttributes { /** * Cast the given value. * * @param \Illuminate\Database\Eloquent\Model $model * @param mixed $value */ public function get($model, string $key, $value, array $attributes): ?float { return $value ? $value / 100 : 0; } /** * Prepare the given value for storage. * * @param \Illuminate\Database\Eloquent\Model $model * @param mixed $value */ public function set($model, string $key, $value, array $attributes): ?int { return $value ? (int) round($value * 100, 2) : 0; } }
| ver. 1.4 |
Github
|
.
| PHP 8.3.28 | Generation time: 0.02 |
proxy
|
phpinfo
|
Settings