Skip to content

Publish and update CORS config for web and multiplatform #157

Description

@DenTray

Description

What needs to be done?

For web and multiplatform projects, publish the CORS configuration file, and update it so CORS settings apply to all application routes.

Required changes:

  • Run the command: php artisan config:publish cors
  • In the published config/cors.php file, change 'paths' => ['api/', 'sanctum/csrf-cookie'] to 'paths' => ['']
  • The config file must be placed in the config directory, which matches the project structure.

Expected Outcome

What is the expected result?

  • For mobile project file config/cors.php doesn't exist.
  • For web and multiplatform projects the file config/cors.php exists in the project.
  • For web and multiplatform projects in config/cors.php, the paths value is set to ['']
  • No other CORS config parameters are changed.

Verification Scenarios

How can this be tested?

  1. Check that the file config/cors.php exists in the web and multiplatform project.
  2. Check that the file config/cors.php doesn't exist in the mobile project.
  3. Open config/cors.php and verify the paths parameter is set to ['']
  4. Compare the published config with the default version and confirm no other parameters were changed unnecessarily.
  5. Test requests to different application routes and confirm CORS headers are applied consistently.

Resources

Materials (Screenshots, Figma Links, References)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions