Skip to content
This repository has been archived by the owner on Oct 28, 2020. It is now read-only.

Latest commit

 

History

History
36 lines (25 loc) · 1.11 KB

database.md

File metadata and controls

36 lines (25 loc) · 1.11 KB
title description extends section
Database
Database
_layouts.documentation
content

Database

Using the app:install Artisan command you can install the database component:

php <your-app-name> app:install database

As you might have already guessed, it is Laravel's Eloquent component that works like a breeze in the Laravel Zero environment too.

Usage:

use DB;

DB::table('users')->insert(
    ['email' => 'enunomaduro@gmail.com']
);

$users = DB::table('users')->get();

Laravel Database Migrations, database factories, and Database Seeding features are also included.

Note on PHAR builds

The database directory isn't included in Laravel Zero standalone PHAR builds by default.

If you are using the Database components migration, factory, or seeder functionality make sure to add the directory to your Box configurations directories section.