Files
Alex Justesen a47e3225e5 Release v1.12.0 (#2493)
Co-authored-by: Sven van Ginkel <svenvanginkel@icloud.com>
Co-authored-by: Alex Justesen <1144087+alexjustesen@users.noreply.github.com>
2025-12-05 15:33:44 -05:00

23 lines
572 B
PHP

<?php
namespace App\Rules;
use Closure;
use Illuminate\Contracts\Validation\ValidationRule;
use Illuminate\Translation\PotentiallyTranslatedString;
class AppriseScheme implements ValidationRule
{
/**
* Run the validation rule.
*
* @param Closure(string):PotentiallyTranslatedString $fail
*/
public function validate(string $attribute, mixed $value, Closure $fail): void
{
if (str_starts_with(strtolower($value), 'http')) {
$fail(__('settings/notifications.apprise_channel_url_validation_error'));
}
}
}