Download the PHP package casperw/laravel-tidy-tables without Composer
On this page you can find all versions of the php package casperw/laravel-tidy-tables. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download casperw/laravel-tidy-tables
More information about casperw/laravel-tidy-tables
Files in casperw/laravel-tidy-tables
Package laravel-tidy-tables
Short Description Structures your database columns nice and tidy.
License MIT
Homepage https://github.com/casperw/laravel-tidy-tables
Informations about the package laravel-tidy-tables
Laravel Tidy Tables
This package provides a way to reorder the columns of all your existing database tables. The sorting algorithm will sort table columns in the following structure:
- Primary key
- Universally unique identifier
- Foreign keys
- Native columns
- Timestamps
Example
For example, I've created a 'products' table. You might recognize the situation on the left, where the table became messy and unstructured.
The table on the right shows how the columns are grouped after running the tidy command.
Installation
Via Composer
Configuration
The defaults are set in config/laraveltidytables.php. Copy this file to your own config directory to modify the values. You can publish the config using this command:
The configuration file contains an array of fields, and an array of data types.
Available fields
Available data types
Note: By default, the configuration supports laravel's default datatypes. Check if your database corrosponds with the default values, and change them if needed!
Usage
The following command will sort all of your database's tables.
Note: Always make sure to back-up your database first.
Change log
Please see the changelog for more information on what has changed recently.
License
MIT. Please see the license file for more information.