Skip to content

chore: contact form min length and Scribe API domain#197

Merged
ManukMinasyan merged 1 commit intomainfrom
chore/contact-validation-scribe-api-domain
Mar 29, 2026
Merged

chore: contact form min length and Scribe API domain#197
ManukMinasyan merged 1 commit intomainfrom
chore/contact-validation-scribe-api-domain

Conversation

@ManukMinasyan
Copy link
Copy Markdown
Contributor

Summary

  • Add min:20 validation to contact form message field to filter spam/low-effort submissions
  • Scribe docs now use API_DOMAIN env var as base URL when set (shows api.relaticle.com instead of relaticle.com)

Test plan

  • Submit contact form with message under 20 chars -- should reject
  • Verify API docs show api.relaticle.com as server after php artisan scribe:generate

- Add min:20 validation to contact form message field
- Use API_DOMAIN env var for Scribe docs base URL when set
Copilot AI review requested due to automatic review settings March 29, 2026 12:45
@ManukMinasyan ManukMinasyan merged commit 599d624 into main Mar 29, 2026
11 checks passed
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds stricter contact form validation to reduce spam/low-effort submissions and updates Scribe configuration so generated API docs can display an API-specific domain when configured.

Changes:

  • Enforce a minimum message length (min:20) on the contact form request validation.
  • Update Scribe docs base_url to prefer app.api_domain (when set) over app.url.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
config/scribe.php Changes the displayed API docs base URL to use app.api_domain when present.
app/Http/Requests/ContactRequest.php Adds min:20 validation to the contact form message field.

'email' => ['required', 'email:rfc,dns', 'max:255'],
'company' => ['nullable', 'string', 'max:255'],
'message' => ['required', 'string', 'max:5000'],
'message' => ['required', 'string', 'min:20', 'max:5000'],
Copy link

Copilot AI Mar 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This validation change alters contact form behavior but there are no automated tests covering contact form submissions in the suite. Please add a feature test that posts to the contact endpoint and asserts messages shorter than 20 characters fail validation (and that a valid message succeeds, eg with Mail::fake()).

Copilot generated this review using guidance from repository custom instructions.
// The base URL displayed in the docs.
// If you're using `laravel` type, you can set this to a dynamic string, like '{{ config("app.tenant_url") }}' to get a dynamic base URL.
'base_url' => config('app.url'),
'base_url' => config('app.api_domain') ? 'https://'.config('app.api_domain') : config('app.url'),
Copy link

Copilot AI Mar 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

base_url hardcodes https:// and drops any scheme/port from app.url. This can produce incorrect server URLs in docs (eg local http, non-standard ports). Consider building the URL the same way as URL::getApiUrl does (derive scheme/port from config('app.url')) instead of hardcoding https.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants