optimizes field types for Postgres.
genealabs/laravel-optimized-postgres is a Laravel package for optimizes field types for postgres..
It currently has 58 GitHub stars and 329.777 downloads on Packagist (latest version 13.0.0).
Install it with composer require genealabs/laravel-optimized-postgres.
Discover more Laravel packages by genealabs
or browse all Laravel packages to compare alternatives.
Last updated
By default I like my Postgres database to use text type for all textual fields.
When you run your migrations with this package installed, it will convert the
following migration types to text: char, and string.
| PHP | Laravel | Support | |-----|---------|---------| | 8.2 | 10, 11 | ✅ | | 8.3 | 10, 11, 12, 13 | ✅ | | 8.4 | 10, 11, 12, 13 | ✅ | | 8.5 | 10, 11, 12, 13 | ✅ |
composer require genealabs/laravel-optimized-postgres
If you are on Laravel 5.5, the service provider will auto-register once the
package is installed. You can skip this step. If you haven't upgraded to
Laravel 5.5 yet, add the following to the providers array in your
\config\app.php file:
GeneaLabs\LaravelOptimizedPostgres\Providers\LaravelOptimizedPostgresService::class,
When writing migrations, be sure to remove the following use statement from the top of the file:
use Illuminate\Support\Facades\Schema;
This is included in the two default migrations provided with Laravel projects,
but I don't believe is added when you make a new migration.