Skip to content

Latest commit

 

History

History
38 lines (22 loc) · 1.76 KB

database.md

File metadata and controls

38 lines (22 loc) · 1.76 KB

Database

Configuration

Lumen makes connecting with databases and running queries extremely simple. Currently Laravel supports four database systems: MySQL, Postgres, SQLite, and SQL Server.

You may use the DB_* configuration options in your .env configuration file to configure your database settings, such as the driver, host, username, and password.

Note: In order for your configuration values to be loaded, you will need to uncomment the Dotenv::load() method call in your bootstrap/app.php file.

Basic Usage

Note: If you would like to use the DB facade, you should uncomment the $app->withFacades() call in your bootstrap/app.php file.

Basic Queries

To learn how to execute basic, raw SQL queries via the database component, you may consult the full Laravel documentation.

Query Builder

Lumen may also utilize the Laravel fluent query builder. To learn more about this feature, consult the full Laravel documentation.

Eloquent ORM

If you would like to use the Eloquent ORM, you should uncomment the $app->withEloquent() call in your bootstrap/app.php file.

Of course, you may easily use the full Eloquent ORM with Lumen. To learn how to use Eloquent, check out the full Laravel documentation.

Migrations

For further information on how to create database tables and run migrations, check out the Laravel documentation on the schema builder and migrator.