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

34 lines
827 B
PHP

<?php
/**
* Holds the alias class for the Illuminate database thing.
*
* @package Sakura
*/
namespace Sakura;
use Illuminate\Database\Capsule\Manager;
use Illuminate\Database\ConnectionResolver;
use Illuminate\Database\Migrations\DatabaseMigrationRepository;
/**
* The Illuminate (Laravel) database wrapper.
*
* @package Sakura
* @author Julian van de Groep <me@flash.moe>
*/
class DB extends Manager
{
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();
}
}