Files
Atomcms-edit/app/Rules/ValidateInstallationKeyRule.php
T
2026-05-09 17:32:17 +02:00

18 lines
439 B
PHP
Executable File

<?php
namespace App\Rules;
use App\Models\Miscellaneous\WebsiteInstallation;
use Closure;
use Illuminate\Contracts\Validation\ValidationRule;
class ValidateInstallationKeyRule implements ValidationRule
{
public function validate(string $attribute, mixed $value, Closure $fail): void
{
if ($value !== WebsiteInstallation::first()->installation_key) {
$fail('The :attribute does not match');
}
}
}