Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[8.x] Document the Artisan db command #6584

Merged
merged 1 commit into from
Nov 23, 2020
Merged
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
12 changes: 12 additions & 0 deletions database.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
- [Configuration](#configuration)
- [Read & Write Connections](#read-and-write-connections)
- [Using Multiple Database Connections](#using-multiple-database-connections)
- [Connecting To The Database CLI](#connecting-to-the-database-cli)
- [Running Raw SQL Queries](#running-queries)
- [Listening For Query Events](#listening-for-query-events)
- [Database Transactions](#database-transactions)
Expand Down Expand Up @@ -103,6 +104,17 @@ You may also access the raw, underlying PDO instance using the `getPdo` method o

$pdo = DB::connection()->getPdo();

<a name="connecting-to-the-database-cli"></a>
## Connecting To The Database CLI

If you wish to connect to the database CLI, you may use the `db` Artisan command. This command figures out which database you're using and starts a database CLI session based on your database configuration parameters.

php artisan db

You may also specify an optional connection argument to connect to a non-default database connection:

php artisan db mysql

<a name="running-queries"></a>
## Running Raw SQL Queries

Expand Down