New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

genealabs/laravel-optimized-postgres

optimizes field types for Postgres.
329,825 58
Install
composer require genealabs/laravel-optimized-postgres
Latest Version:13.0.0
PHP:^8.2
Laravel:10 – 13
Older releases:5 – 9
License:MIT
Last Updated:Aug 18, 2026
Links: GitHub  ·  Packagist
Maintainer: mikebronner

Optimized Postgres for Laravel

Optimized Postgres for Laravel

Join the chat at https://gitter.im/GeneaLabs/laravel-optimized-postgres

Impetus

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.

Installation

Requirements

  • PHP 8.2+
  • Laravel 10, 11, 12, or 13

Version Support

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 Command

composer require genealabs/laravel-optimized-postgres

Service Provider

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,

Usage

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.

Future Updates

  • possibly expand to normalize numbers, more research needed.

Related Packages

doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database s...

648,266,899 9,701
laravel/framework

The Laravel Framework.

604,216,237 34,982
laravel/tinker

Powerful REPL for the Laravel framework.

512,508,631 7,443
laravel/serializable-closure

Laravel Serializable Closure provides an easy and secure way to serialize closur...

429,221,767 607
nunomaduro/collision

Cli error handling for console/command-line PHP applications.

407,699,310 4,663

Version History

Version Released PHP Laravel License
13.0.0 ^8.2 ^10.0|^11.0|^12.0|^13.0 MIT
12.0.1 ^8.2 ^10.0|^11.0|^12.0 MIT
12.0.0 ^8.2 ^10.0|^11.0|^12.0 MIT
10.0.0 ^8.2 ^10.0 MIT
0.5.1 ^8.0 ^9.0 MIT