- What is platformsh/laravel-bridge used for?
- platformsh/laravel-bridge is a Composer package that helps Laravel applications run on Platform.sh. It maps Platform.sh environment variables and managed service relationships into Laravel configuration so databases, caches, and other resources can be used with minimal custom setup. It is intended to bridge the gap between Platform.sh's environment model and Laravel's configuration model.
- How do I install platformsh/laravel-bridge in a Laravel app?
- Install it as a Composer dependency using composer require platformsh/laravel-bridge. Then follow the package repository instructions for any service provider or configuration publishing steps. Check the repository's composer.json for the supported Laravel and PHP version constraints before installing.
- Which Laravel and PHP versions are supported?
- The exact supported Laravel and PHP versions are defined in the package's composer.json and release notes. Check the repository before upgrading Laravel or PHP to confirm compatibility. Because this is a bridge package, compatibility may also depend on your Platform.sh environment configuration.
- How does it map Platform.sh environment variables into Laravel config?
- The bridge translates Platform.sh environment information and service relationship data into Laravel configuration values. That lets Laravel read the correct credentials and connection details for managed services instead of relying only on manually maintained .env values. The exact mappings depend on the services and relationships defined in your Platform.sh configuration.
- Can I use platformsh/laravel-bridge locally without Platform.sh?
- Yes, you can run the Laravel application locally, but the automatic Platform.sh environment mapping only has Platform.sh data when running in that environment. For local development, you typically provide standard Laravel .env values or emulate the relevant environment variables. This keeps local and cloud behavior close while avoiding dependence on Platform.sh-only data.
- Does it work with Laravel cache, sessions, and queues?
- The bridge helps Laravel use Platform.sh managed services such as databases and caches, so cache and session drivers can be backed by those resources when configured. Queue support depends on the queue driver and the services you define in Platform.sh. The bridge maps available service relationships rather than replacing Laravel's own cache, session, or queue configuration.
- Do I still need to configure database and Redis services manually?
- You still define the services and relationships in your Platform.sh configuration. The bridge uses that information to populate Laravel configuration, reducing manual credential handling. You may still need to set Laravel driver options and application-specific settings explicitly.
- Is platformsh/laravel-bridge suitable for production?
- It is designed for running Laravel applications on Platform.sh, including production deployments. Before relying on it, test your service mappings, environment variables, and configuration in a staging environment. Also review the package's maintenance status and compatibility with your Laravel version.
- How can I test that the bridge is working?
- Verify that Laravel configuration resolves to the expected Platform.sh service credentials, then run migrations and exercise database and cache connections. In a Platform.sh environment, inspect configuration through artisan commands or application logging. Locally, confirm that fallback .env values still work as expected.
- What are the alternatives to platformsh/laravel-bridge?
- Alternatives include manually mapping Platform.sh environment variables in Laravel configuration, using generic deployment scripts, or relying on Platform.sh's standard environment tooling without a Laravel-specific bridge. The best choice depends on how much automatic service mapping you want versus maintaining configuration yourself.