Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/stacksDockerDeployProduction.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ jobs:
working-directory: amp-laravel
run: |
echo "APP_KEY=${{ secrets.LARAVEL_APP_KEY }}" > .env.example
echo "APP_URL=http://${{ secrets.EC2_HOST_STAGING }}:8000" > .env.example
echo "DB_CONNECTION=mysql" >> .env.example
echo "DB_HOST=${{ secrets.LARAVEL_DATABASE_HOST }}" >> .env.example
echo "DB_PORT=${{ secrets.LARAVEL_DATABASE_PORT_NUMBER }}" >> .env.example
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/stacksDockerDeployStaging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ jobs:
working-directory: amp-laravel
run: |
echo "APP_KEY=${{ secrets.LARAVEL_APP_KEY }}" > .env.example
echo "APP_URL=http://${{ secrets.EC2_HOST_STAGING }}:8000" > .env.example
echo "DB_CONNECTION=mysql" >> .env.example
echo "DB_HOST=${{ secrets.LARAVEL_DATABASE_HOST }}" >> .env.example
echo "DB_PORT=${{ secrets.LARAVEL_DATABASE_PORT_NUMBER }}" >> .env.example
Expand Down
2 changes: 2 additions & 0 deletions amp-laravel/.env.example
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
APP_URL=${LARAVEL_APP_URL}

APP_KEY=${LARAVEL_APP_KEY}

DB_CONNECTION=mysql
Expand Down
25 changes: 25 additions & 0 deletions amp-laravel/config/cors.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

return [

'paths' => ['api/*', 'sanctum/csrf-cookie'],

'allowed_methods' => ['*'],

'allowed_origins' => [
Copy link

Choose a reason for hiding this comment

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

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.

'http://fse-final-riyad.s3-website.eu-west-3.amazonaws.com',
'http://localhost:5173',
'http://127.0.0.1:5173',
],

'allowed_origins_patterns' => [],

'allowed_headers' => ['*'],

'exposed_headers' => [],

'max_age' => 0,

'supports_credentials' => true,

];