17 lines
339 B
PHP
17 lines
339 B
PHP
<?php
|
|
|
|
namespace App\Models\Validation\Validators;
|
|
|
|
use App\Models\Validation\Validators\NextValidatorByName;
|
|
use App\Models\City;
|
|
|
|
class CityValidatorByName extends NextValidatorByName
|
|
{
|
|
public function isCurrentValid(): bool
|
|
{
|
|
$count = City::where('name', $this->getName())->count();
|
|
|
|
return $count != 0;
|
|
}
|
|
}
|