This commit is contained in:
Philipp Lang 2023-02-13 09:32:11 +01:00
parent 927bf7a09c
commit d48383ded4
2 changed files with 1 additions and 17 deletions

View File

@ -1,16 +0,0 @@
<?php
namespace Zoomyboy\LaravelNami\Casters;
use Carbon\Carbon;
use Spatie\DataTransferObject\Caster;
class NullableCarbonCaster implements Caster
{
public function cast(mixed $value): ?Carbon
{
return $value
? Carbon::parse($value)
: null;
}
}

View File

@ -8,7 +8,7 @@ use Spatie\LaravelData\Transformers\Transformer;
class CarbonTransformer implements Transformer
{
public function __construct(
protected array|string|null $format = null
protected ?string $format = null
) {
}