admin_pages_dev: Modified Laravel Configurations#182
Merged
Riyad-Murad merged 1 commit intomainfrom May 21, 2025
Merged
Conversation
Reviewer's GuideThis PR enhances deployment workflows by injecting the application URL into the generated .env.example files for both staging and production, and sets up a dedicated CORS configuration in Laravel to allow requests from specified origins. Sequence Diagram: Updated .env.example Generation in CI/CDsequenceDiagram
title "Updated .env.example Generation in CI/CD"
participant Job as "CI/CD Job"
participant Script as "Shell Script in Job"
participant EnvExample as ".env.example"
participant Secrets as "GitHub Secrets"
Job->>Script: Execute .env.example generation
Script->>Secrets: Access LARAVEL_APP_KEY
Script->>EnvExample: Write APP_KEY (using '>')
Script->>Secrets: Access EC2_HOST_STAGING
Script->>EnvExample: Write APP_URL (using '>')
Script->>Secrets: Access DB credentials etc.
Script->>EnvExample: Append DB_CONNECTION (using '>>')
Script->>EnvExample: Append other DB settings (using '>>')
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey @Riyad-Murad - I've reviewed your changes - here's some feedback:
- In the GitHub workflows you’re using
>for the APP_URL line, which overwrites the file; switch to>>so it appends instead of clobbering previous env entries. - Hardcoding
http://and port:8000in APP_URL may break onboarding in other environments—consider exposing the full URL as a secret or workflow input instead of embedding it. - For config/cors.php, pulling allowed origins from an environment variable or a shared config would make it easier to add or remove domains without editing code.
Here's what I looked at during the review
- 🟡 General issues: 1 issue found
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
|
|
||
| 'allowed_methods' => ['*'], | ||
|
|
||
| 'allowed_origins' => [ |
There was a problem hiding this comment.
suggestion: Hardcoded CORS origins missing production URL
Use environment variables or allowed_origins_patterns for allowed origins and include your production front-end domain so CORS works in production.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary by Sourcery
Configure Laravel application to support CORS and ensure CI workflows populate the APP_URL environment variable
Enhancements:
CI: