* #36 - wip * #36 - wip * #36 - wip * #36 - added some translations * #36 - fix * #36 - fix Co-authored-by: EwelinaLasowy <ewelina.lasowy@blumilk.pl>
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Toby\Domain\Validation\Rules;
|
||||
|
||||
use Toby\Eloquent\Models\VacationRequest;
|
||||
|
||||
class VacationRangeIsInTheSameYearRule implements VacationRequestRule
|
||||
{
|
||||
public function check(VacationRequest $vacationRequest): bool
|
||||
{
|
||||
return $vacationRequest->from->isSameYear($vacationRequest->to);
|
||||
}
|
||||
|
||||
public function errorMessage(): string
|
||||
{
|
||||
return __("The vacation request cannot be created at the turn of the year.");
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user