This repository has been archived on 2024-06-26. You can view files and clone it, but cannot push or open issues or pull requests.
sakura/app/DB.php

35 lines
827 B
PHP
Raw Normal View History

2016-02-18 23:28:44 +00:00
<?php
/**
2016-02-25 16:06:29 +00:00
* Holds the alias class for the Illuminate database thing.
2016-03-08 23:07:58 +00:00
*
2016-02-18 23:28:44 +00:00
* @package Sakura
*/
namespace Sakura;
use Illuminate\Database\Capsule\Manager;
use Illuminate\Database\ConnectionResolver;
use Illuminate\Database\Migrations\DatabaseMigrationRepository;
2016-02-18 23:28:44 +00:00
/**
2016-02-25 16:06:29 +00:00
* The Illuminate (Laravel) database wrapper.
2016-03-08 23:07:58 +00:00
*
2016-02-18 23:28:44 +00:00
* @package Sakura
* @author Julian van de Groep <me@flash.moe>
*/
2016-02-25 16:06:29 +00:00
class DB extends Manager
2016-02-18 23:28:44 +00:00
{
public static function getMigrationRepository()
{
$resolver = new ConnectionResolver(['database' => self::connection()]);
$repository = new DatabaseMigrationRepository($resolver, 'migrations');
$repository->setSource('database');
return $repository;
}
public static function getSchemaBuilder()
{
return self::connection()->getSchemaBuilder();
}
2016-02-18 23:28:44 +00:00
}