howlowck / db-manager
makes database management a little easier
Requires
- php: >=5.4.0
- doctrine/dbal: 2.5.*@dev
- fzaninotto/faker: 1.4.*
- howlowck/support: *
- illuminate/database: 4.1.x
- illuminate/support: 4.1.x
Requires (Dev)
- mockery/mockery: 0.8.*
- phpunit/phpunit: 3.7.*
This package is not auto-updated.
Last update: 2024-11-19 00:59:10 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
- Add in your composer.json
"howlowck/db-manager": "dev-master"
- Add in your
app/config/app.php
service provider:'Howlowck\DbManager\DbManagerServiceProvider'
- (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 excludesmigrations
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()
...