Enhanced PostgresSQL Driver for Laravel

Packages

September 22nd, 2021

laravel-postgresql-extended-featured.png

Laravel PostgreSQL Enhanced is a package by Tobias Petry that offers many missing PostgreSQL-specific features to Laravel:

While in some applications, you want to support multiple database drivers using Eloquent, this package can offer additional features if you're going to opt-in to making your application PostgreSQL-specific.

This package offers various index features, such as partial index support, include columns, index storage parameters. For example, the partial index support feature could be helpful when you have a table with a unique value (i.e., email) and you want to index to ignore rows with soft deletes:

1Schema::table('users', function(Blueprint $table) {
2 $table
3 ->uniqueIndex('email')
4 ->partial("deleted_at IS NULL");
5});

Besides these features, the package includes multiple column types that are available in PostgreSQL:

  • Bit Strings
  • Case-insensitive text (i.e., emails)
  • Hstore
  • IP Networks
  • International Product Numbers
  • Label Tree
  • Ranges
  • XML

I'd recommend checking out the readme for details on all the features this package provides. You can learn more about this package, get full installation instructions, and view the source code on GitHub.

Filed in:

Paul Redmond

Full stack web developer. Author of Lumen Programming Guide and Docker for PHP Developers.