mirror of
https://github.com/alexjustesen/speedtest-tracker.git
synced 2026-06-23 06:50:09 +00:00
a47e3225e5
Co-authored-by: Sven van Ginkel <svenvanginkel@icloud.com> Co-authored-by: Alex Justesen <1144087+alexjustesen@users.noreply.github.com>
23 lines
572 B
PHP
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'));
|
|
}
|
|
}
|
|
}
|