Skip to content

Conversation

@pirs1337
Copy link
Contributor

refs: #206

Copy link
Contributor

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

This PR adds validation for relation names in get and search requests by introducing a getAvailableRelations() method that returns a whitelist of allowed relations. The validation rule uses Laravel's in: validator to ensure only specified relations can be requested through the with parameter.

  • Adds getAvailableRelations() method to define allowed relations
  • Updates validation rules for with.* parameter to use in: validator
  • Includes a TODO comment reminding developers to review the relations list

Reviewed Changes

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

Show a summary per file
File Description
stubs/request.blade.php Template updated to conditionally include relation validation logic and the getAvailableRelations() method
src/Generators/RequestsGenerator.php Generator logic updated to detect with.* parameter and add in: rule for validation
tests/fixtures/RequestGeneratorTest/search_request.php Test fixture showing expected output with relation validation for search requests
tests/fixtures/RequestGeneratorTest/get_request.php Test fixture showing expected output with relation validation for get requests
tests/fixtures/CommandTest/search_request_subfolder_model.php Test fixture for subfolder model scenario with relation validation
tests/fixtures/CommandTest/search_request.php Test fixture for basic search request with relation validation
tests/fixtures/CommandTest/get_request.php Test fixture for basic get request with relation validation
Comments suppressed due to low confidence (1)

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@DenTray DenTray requested a review from Copilot October 23, 2025 05:30
Copy link
Contributor

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

Copilot reviewed 7 out of 7 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (1)

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

DenTray and others added 6 commits October 23, 2025 11:31
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@DenTray DenTray merged commit 5b6930c into master Oct 23, 2025
4 checks passed
@DenTray DenTray deleted the 206_Add-relations-validation-in-GetRequest-and-SearchRequest- branch October 23, 2025 06:20
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.

3 participants