include missing
This commit is contained in:
parent
88b5850c32
commit
d3e12785bb
20 changed files with 584 additions and 4 deletions
22
tests/Classes/CarbonPeriodMapper.php
Normal file
22
tests/Classes/CarbonPeriodMapper.php
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
<?php
|
||||
|
||||
namespace Tests\Classes;
|
||||
|
||||
use Carbon\CarbonPeriodImmutable;
|
||||
use Illuminate\Support\Carbon;
|
||||
|
||||
class CarbonPeriodMapper
|
||||
{
|
||||
public function map(mixed $value): CarbonPeriodImmutable
|
||||
{
|
||||
return new CarbonPeriodImmutable(Carbon::parse($value['start']), Carbon::parse($value['end']));
|
||||
}
|
||||
|
||||
public static function rules(): array
|
||||
{
|
||||
return [
|
||||
'start' => ['required', 'date'],
|
||||
'end' => ['required', 'date'],
|
||||
];
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue