GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - illuminate/database: [READ ONLY] Subtree split of the Illuminate Database component (see laravel/framework)

BranchesTags
Open more actions menu

Latest commit

 

History

8,456 Commits
8,456 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
Capsule
Capsule
 
 
Concerns
Concerns
 
 
Connectors
Connectors
 
 
Console
Console
 
 
Eloquent
Eloquent
 
 
Events
Events
 
 
Migrations
Migrations
 
 
Query
Query
 
 
Schema
Schema
 
 
.gitattributes
.gitattributes
 
 
ClassMorphViolationException.php
ClassMorphViolationException.php
 
 
ConcurrencyErrorDetector.php
ConcurrencyErrorDetector.php
 
 
ConfigurationUrlParser.php
ConfigurationUrlParser.php
 
 
Connection.php
Connection.php
 
 
ConnectionInterface.php
ConnectionInterface.php
 
 
ConnectionResolver.php
ConnectionResolver.php
 
 
ConnectionResolverInterface.php
ConnectionResolverInterface.php
 
 
DatabaseManager.php
DatabaseManager.php
 
 
DatabaseServiceProvider.php
DatabaseServiceProvider.php
 
 
DatabaseTransactionRecord.php
DatabaseTransactionRecord.php
 
 
DatabaseTransactionsManager.php
DatabaseTransactionsManager.php
 
 
DeadlockException.php
DeadlockException.php
 
 
DetectsConcurrencyErrors.php
DetectsConcurrencyErrors.php
 
 
DetectsLostConnections.php
DetectsLostConnections.php
 
 
Grammar.php
Grammar.php
 
 
LICENSE.md
LICENSE.md
 
 
LazyLoadingViolationException.php
LazyLoadingViolationException.php
 
 
LostConnectionDetector.php
LostConnectionDetector.php
 
 
LostConnectionException.php
LostConnectionException.php
 
 
MariaDbConnection.php
MariaDbConnection.php
 
 
MigrationServiceProvider.php
MigrationServiceProvider.php
 
 
MultipleColumnsSelectedException.php
MultipleColumnsSelectedException.php
 
 
MultipleRecordsFoundException.php
MultipleRecordsFoundException.php
 
 
MySqlConnection.php
MySqlConnection.php
 
 
PostgresConnection.php
PostgresConnection.php
 
 
QueryException.php
QueryException.php
 
 
README.md
README.md
 
 
RecordNotFoundException.php
RecordNotFoundException.php
 
 
RecordsNotFoundException.php
RecordsNotFoundException.php
 
 
SQLiteConnection.php
SQLiteConnection.php
 
 
SQLiteDatabaseDoesNotExistException.php
SQLiteDatabaseDoesNotExistException.php
 
 
Seeder.php
Seeder.php
 
 
SqlServerConnection.php
SqlServerConnection.php
 
 
UniqueConstraintViolationException.php
UniqueConstraintViolationException.php
 
 
composer.json
composer.json
 
 

Repository files navigation

Illuminate Database

The Illuminate Database component is a full database toolkit for PHP, providing an expressive query builder, ActiveRecord style ORM, and schema builder. It currently supports MySQL, Postgres, SQL Server, and SQLite. It also serves as the database layer of the Laravel PHP framework.

Usage Instructions

First, create a new "Capsule" manager instance. Capsule aims to make configuring the library for usage outside of the Laravel framework as easy as possible.

use Illuminate\Database\Capsule\Manager as Capsule;

$capsule = new Capsule;

$capsule->addConnection([
    'driver' => 'mysql',
    'host' => 'localhost',
    'database' => 'database',
    'username' => 'root',
    'password' => 'password',
    'charset' => 'utf8',
    'collation' => 'utf8_unicode_ci',
    'prefix' => '',
]);

// Set the event dispatcher used by Eloquent models... (optional)
use Illuminate\Events\Dispatcher;
use Illuminate\Container\Container;
$capsule->setEventDispatcher(new Dispatcher(new Container));

// Make this Capsule instance available globally via static methods... (optional)
$capsule->setAsGlobal();

// Setup the Eloquent ORM... (optional; unless you've used setEventDispatcher())
$capsule->bootEloquent();

composer require "illuminate/events" required when you need to use observers with Eloquent.

Once the Capsule instance has been registered. You may use it like so:

Using The Query Builder

$users = Capsule::table('users')->where('votes', '>', 100)->get();

Other core methods may be accessed directly from the Capsule in the same manner as from the DB facade:

$results = Capsule::select('select * from users where id = ?', [1]);

Using The Schema Builder

Capsule::schema()->create('users', function ($table) {
    $table->increments('id');
    $table->string('email')->unique();
    $table->timestamps();
});

Using The Eloquent ORM

class User extends Illuminate\Database\Eloquent\Model {}

$users = User::where('votes', '>', 1)->get();

For further documentation on using the various database facilities this library provides, consult the Laravel framework documentation.

About

[READ ONLY] Subtree split of the Illuminate Database component (see laravel/framework)

Resources

Readme
MIT license
Activity
Custom properties

Stars

2.8k stars

Watchers

109 watching

Forks

604 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.