Tinkerwell 4 is out now! Get the most popular PHP Scratchpad application. Tinkerwell 4 is out now: Get the most popular PHP Scratchpad with Detail Dive, AI code generation and more. Learn more
If you are using a project hosted on Laravel Vapor, you can use Invoker by accessing your local codebase and establish an SSH tunnel to your Vapor/AWS database.
We will look into how we can simplify the setup in future versions of Invoker, but in the meantime you can use this workaround to connect Invoker with a database on AWS/Laravel Vapor:
Create a Jumpbox on Laravel Vapor, to connect to your database (depending on your database setup, this might not be required)
Create an SSH tunnel to your jumpbox for your database port. Replace YOUR-VAPOR-JUMPBOX-PRIVATE-KEY
with the location of the private key used for your jumpbox and YOUR-VAPOR-JUMPBOX-HOST
with the host of your Vapor jumpbox.
ssh -i ~/YOUR-VAPOR-JUMPBOX-PRIVATE-KEY -N -L 13306:[database host]:3306 ec2-user@YOUR-VAPOR-JUMPBOX-HOST
Modify your .env
file to include the username and password from your Vapor provisioned database, as well as the tunneled port of your Jumpbox (13306 in the example above).
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=13306
DB_DATABASE=vapor
DB_USERNAME=vapor
DB_PASSWORD=secret
In Invoker, you can now open your local project and it will connect to your Vapor hosted database, through the Jumpbox SSH tunnel.