Skip to content

Connect Laravel to SQLEye

Set the DB_* variables in your .env file. The instance’s Info tab has a “Laravel .env” block you can copy.

DB_CONNECTION=pgsql
DB_HOST=127.0.0.1
DB_PORT=5432
DB_DATABASE=myapp
DB_USERNAME=postgres
DB_PASSWORD=
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=myapp
DB_USERNAME=root
DB_PASSWORD=

Replace the port with your instance’s port. Create the database first, see CLI clients. Then run php artisan migrate.

Laravel’s config/database.php reads these variables, and it also accepts a single DB_URL such as mysql://root@127.0.0.1:3306/myapp instead of separate values (its documented form is driver://username:password@host:port/database).

Terminal window
php artisan db:show

Source: Laravel database docs. To see the queries Laravel runs, including N+1 loops, turn on capture.

SQLEye is developed and maintained by CodeROG. This page is also available as Markdown.