howlowck/db-manager

There is no license information available for the latest version (dev-master) of this package.

makes database management a little easier

dev-master 2013-12-17 03:54 UTC

This package is not auto-updated.

Last update: 2024-04-08 22:08:50 UTC


README

Notice! This package requires Doctrine/DBAL. As of Laravel 4.1, Laravel is not dependent on Doctrine, but you can still use doctrine, if you include "doctrine/dbal": "2.5.*@dev" in your composer.json.

Laravel Package for Database management easier.

  • Lists all the tables in the database
  • Lists all the columns of a table
  • Get datatype of a column

Install

  1. Add in your composer.json "howlowck/db-manager": "dev-master"
  2. Add in your app/config/app.php service provider: 'Howlowck\DbManager\DbManagerServiceProvider'
  3. (optional) add the facade: 'DbManager' => 'Howlowck\DbManager\Facades\DbManager',

Usage

(If you use the Facade: )

  • DbManager::listTables( [optional] $exclude ) -- lists all the tables in your database, $exclude is an array that you want to exclude from the final result (Note: by default, it excludes migrations table);

  • DbManager::listColumns($table, [optional] $exclude) -- lists all the columns in the given table.

  • DbManager::getColumnType($table, $columnName) -- returns the type name of a column

(If you choose to only use the service provider)

App::make('dbmanager')->listTables() ...