howlowck / db-manager by howlowck

makes database management a little easier
12
3
2
Package Data
Maintainer Username: howlowck
Maintainer Contact: haowebdev@gmail.com (Hao Luo)
Package Create Date: 2013-10-20
Package Last Update: 2013-12-17
Language: PHP
License: Unknown
Last Refreshed: 2024-12-24 15:00:09
Package Statistics
Total Downloads: 12
Monthly Downloads: 0
Daily Downloads: 0
Total Stars: 3
Total Watchers: 2
Total Forks: 2
Total Open Issues: 0

db-manager Bitdeli Badge Build Status

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() ...