• Stars
    star
    111
  • Rank 304,388 (Top 7 %)
  • Language
    PHP
  • License
    MIT License
  • Created over 7 years ago
  • Updated over 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Display the connected database information from Terminal.

Laravel Schema

This package will help to display database schema information from terminal.


Installation

Via Composer

$ composer require thedevsaddam/laravel-schema

Install manually (add the line to composer.json file)

"thedevsaddam/laravel-schema": "^2.0"

Then open your terminal and hit the command

composer update

Add the following line to config/app.php file's providers array

Thedevsaddam\LaravelSchema\LaravelSchemaServiceProvider::class,

For lumen open bootstrap/app.php and add the line below

$app->register(Thedevsaddam\LaravelSchema\LaravelSchemaServiceProvider::class);

Available commands / Features

  1. php artisan schema:help Display the available commands and usages.
  2. php artisan schema:simple Display overall tables with total rows count.
  3. php artisan schema:list Display all the available tables. schema information in list (please see details below).
  4. php artisan schema:show Display all the available tables schema information in tabular form (please see details below).
  5. php artisan schema:table --t=yourTableName or --t=Namespace\\Model Display a table's paginated data (please see details below).
  6. php artisan schema:query --r="wirte your raw sql query in double quote" Perform a sql query.
  7. php artisan schema:monitor Display database server status.

Usage in details

Show Schema information in tabular form

 php artisan schema:show

Example output: Schema information in tabular form

Schema information in tabular form

If you want to see a specific table then pass table name or Namespace\\Model

 php artisan schema:show --t=tableName or --t=Namespace\\Model

database info commandline

Note: Same condition will be applied for tables list view

Show Schema information in List

 php artisan schema:list

Example output: Schema information in list

database info commandline

Avaliable Options in show and list:

  • --t=tableName or -t tableName to provide table name or Namespace\Model
  • --c=connectionName or -c connectionName to provide connection name

Show Table names and total rows

 php artisan schema:simple

Example output: Tables name with rows count

Tables name with rows count

Note: You may pass --c=connectionName or -c connectionName to display a specific connection schema info

Show table definition

 php artisan schema:table --t=tableName or --t=Namespace\\Model

Example output: Table definition with default page and limit

Table definition with default page and limit

Avaliable Options in table:

  • --t=tableName or -t tableName to provide table name or Namespace\\Model (e.g: --t=App\\User or --t=users).
  • --p=pageNumber or -p PageNumber to provide current page which you want to see
  • --o=orderBy or -o orderBy to provide orderBy clause against a column (e.g: --o=id:desc or --o=id:asc [default asc]).
  • --l=rowsLimitPerPage or -l rowsLimitPerPage to provide number of rows you want to display (e.g: --l=20).
  • --c=connectionName or -c connectionName to provide connection name
  • --w=widthOfTableCell or -w widthOfTableCell to provide character length of cell to show in tables (numeric [default=10]).
  • --s=columnName to provide the column to display, you can provide comma (,) separated names to display (e.g: --s=name or --s=id,name).
php artisan schema:table --t=countries --p=4 --o=id:desc --l=25

Perform raw sql query

 php artisan schema:query --r="your sql query"

Example output: Query result will be dumped in console

Query result will be dumped in console

Avaliable Options in query:

  • --r=yourRawQuery or -r yourRawQuery to provide your raw sql query (e.g: --r="select * from someTable limit 20").
  • --c=connectionName or -c connectionName to provide connection name (e.g: --c=mysql or -c sqlite)

Monitor database server

 php artisan schema:monitor

Example output: Showing the database status

Schema information in tabular form

You can pass --i=integerNumber as refresh time interval and --c=ConnectionName as well

 php artisan schema:monitor --i=3 --c=secondaryDatabase

License

The laravel-schema is a open-source software licensed under the MIT License.

Thank you :)

More Repositories

1

gojsonq

A simple Go package to Query over JSON/YAML/XML/CSV Data
Go
2,138
star
2

govalidator

Validate Golang request data with simple rules. Highly inspired by Laravel's request validation.
Go
1,273
star
3

docgen

Transform your postman collection to HTML/Markdown documentation
Go
935
star
4

renderer

Simple, lightweight and faster response (JSON, JSONP, XML, YAML, HTML, File) rendering package for Go
Go
261
star
5

task

Terminal tasks todo with reminder tool for geek
Go
81
star
6

retry

Simple and easy retry mechanism package for Go
Go
65
star
7

dl

Command-line file downloader tool
Go
47
star
8

ubuntu-live-wallpaper

Live wallpaper changer for ubuntu. Inspired from chrome momentum extension
Python
45
star
9

lumen-route-list

Display all the registered route list in lumen application just like laravel.
PHP
35
star
10

orchid-micro

Golang boilerplate using gin-gonic framework and gorm for microservice
Go
30
star
11

todoapp

Tutorial purpose repository
Go
27
star
12

docgen-bin

Transform your postman collection to html documentation
26
star
13

slack-notifier

This script will help you to send slack scheduled notification (message)
Python
22
star
14

world-countries

Provide world country list with country code, city, states and flag
PHP
19
star
15

gomailer

Gomailer provides a simple email interface to integrate third party email services.
Go
14
star
16

bongo

Terminal based bengali calendar
Go
14
star
17

ponjika

Tiny bengali ponjika based on Gregorian date
Go
12
star
18

orchid

A MVC style boilerplate for golang
Go
11
star
19

snapshot

Robust, Persistent, Key-Value (KV) store purely written in Golang
Go
11
star
20

traffic

Thread safe load-balancer package for Golang
Go
10
star
21

radar

Package radar help to debug nested function call and Trace current file/line
Go
9
star
22

unpack

Go assignment by slice, array unpacking or destructuring
Go
9
star
23

q

[WIP] "q" a command-line tool to query JSON/XML/YAML/CSV document
Go
8
star
24

iter

Iter provides functionality like Python's range function to iterate over numbers and letters
Go
8
star
25

querybuilder

A fake query builder to demonstrate the factory and singleton pattern
Go
7
star
26

multiple_route

MultipleRoute generator is helpful create any number of routes for your large laravel project.
PHP
6
star
27

clean

[WIP] Trying to make a boilerplate for clean-architecture in Golang
Go
5
star
28

task_binaries

Task binary files
5
star
29

timezones

PHP supported timezones array
PHP
4
star
30

dictionary

Offline terminal dictionary
Go
3
star
31

dj1.9

learning django 1.9 with python 3
Python
3
star
32

vue1-learning

Playing with vue.js v1.0
HTML
3
star
33

thedevsaddam

Portfolio Page
3
star
34

enToBnDigit

English digit to bengali digit...
PHP
3
star
35

thedevsaddam.github.io

Personal blog site
CSS
3
star
36

py-ghataghati

Just trying to figure out python
Python
3
star
37

py-app

Learning django
Python
3
star
38

go-repl

GO REPL is a simple application promising to write/compile/run code in terminal, inspired by python shell
Go
3
star
39

pc-ready

Its a shell script that will setup essential software and development environment for your Ubuntu OS
Shell
3
star
40

vue-simple-todo

Simple vue todo
HTML
3
star
41

go-ladder

Database migration package for golang inspired by Laravel migration
3
star
42

dj-project

Learning django...
Python
3
star
43

erlang

Playing with Erlang
Erlang
2
star
44

files

Contains files for public repositories
2
star
45

homebrew-cli

Contains formula for different tools for mac
Ruby
2
star
46

es6

ECMAScript 6, also known as ECMAScript 2015
JavaScript
2
star
47

worker

Go
2
star
48

go_repl_binaries

GO REPL is a simple application promising to write/compile/run code in terminal, inspired by python shell
2
star
49

ubuntu-500px-wallpaper

Inspired from chrome momentum extension. Get new wallpaper from 500px popular section, each time restart the computer.
Shell
2
star
50

30-seconds-of-go

2
star
51

reactjs

Learning react js
JavaScript
2
star
52

tweet-release

Go
1
star
53

action

GitHub action to supercharge your pull requests workflows!
Go
1
star
54

assessment-200

Python
1
star
55

lo_

A modern Rust utility library delivering modularity, performance & extras proted from JavaScript Lodash
Rust
1
star