*/ public function rules(): array { return [ 'driver' => ['required', Rule::in(['cloud', 'local', 'ollama'])], 'ollama_url' => [ Rule::requiredIf(fn () => $this->input('driver') === 'ollama'), 'nullable', 'url', 'regex:/^https?:\/\//i', ], ]; } /** * @return array */ public function messages(): array { return [ 'driver.required' => 'Choose a transcription engine.', 'ollama_url.required' => 'Enter the URL of the Ollama host (OpenAI-compatible Whisper endpoint).', 'ollama_url.url' => 'Enter a valid URL, e.g. http://192.168.1.50:8000', 'ollama_url.regex' => 'The host URL must start with http:// or https://', ]; } }