Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Quickly Inspect Database & Tables in Laravel

Let’s say you want to inspect the database to find information such as the number of open connections, the size of the database, the number of tables, and more.

Normally, you would use a database management tool.

But in Laravel, you can quickly do this from the command line with

php artisan db:show

This command gives you a summary of the database, including its type, connection details, port, and more.

Prefer a video instead?

Now let’s say you want to inspect a table to figure out its structure: columns, indexes, size, and so on.

You can do this with

php artisan db:table {table-name}

The command lists the size of the table, the columns and their data types, and also the indexes.

If you run the command without the name of the table, it will show you a list of the tables you can choose from.

php artisan db:table

That is all!

Happy coding



This post first appeared on Neutron Dev, please read the originial post: here

Share the post

Quickly Inspect Database & Tables in Laravel

×

Subscribe to Neutron Dev

Get updates delivered right to your inbox!

Thank you for your subscription

×