app/Rules/ValidLicense.php
use Illuminate\Contracts\Validation\Rule;use Illuminate\Support\Facades\Http; class ValidLicense implements Rule{ public function passes($attribute, $value) { return config('app.cloud') || $this->checkLicense($value); } protected function checkLicense(string $license): bool { if (app()->environment('local')) { return true; } return Http::get("https://archboard.io/verify/{$license}") ->json('valid'); } public function message() { return 'The validation error message.'; }}