Download the PHP package umbrellio/laravel-pg-extensions without Composer
On this page you can find all versions of the php package umbrellio/laravel-pg-extensions. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download umbrellio/laravel-pg-extensions
More information about umbrellio/laravel-pg-extensions
Files in umbrellio/laravel-pg-extensions
Package laravel-pg-extensions
Short Description Extensions for Postgres Laravel
License MIT
Informations about the package laravel-pg-extensions
Laravel PG extensions
This project extends Laravel's database layer to allow use specific Postgres features without raw queries.
Installation
Run this command to install:
Features
- Extended
Schema::create()
- Added Support NUMERIC Type
- Extended
Schema
with USING - Extended
Schema
for views - Working with UNIQUE indexes
- Working with EXCLUDE constraints
- Working with CHECK constraints
- Working with partitions
- Check existing index before manipulation
- Getting foreign keys for table
Extended table creation
Example:
Extended Schema USING
Example:
Create views
Example:
Get foreign keys
Example:
Extended unique indexes creation
Example:
If you want to delete partial unique index, use this method:
$table->dropUnique()
doesn't work for Partial Unique Indexes, because PostgreSQL doesn't
define a partial (ie conditional) UNIQUE constraint. If you try to delete such a Partial Unique
Index you will get an error.
When you create a unique index without conditions, PostgresSQL will create Unique Constraint automatically for you, and when you try to delete such an index, Constraint will be deleted first, then Unique Index.
Exclude constraints creation
Using the example below:
An Exclude Constraint will be generated for your table:
Check constraints creation
Using the example below:
An Check Constraint will be generated for your table:
Partitions
Support for attaching and detaching partitions.
Example:
Check existing index
Numeric column type
Unlike standard laravel decimal
type, this type can be with variable precision
Custom Extensions
1). Create a repository for your extension.
2). Add this package as a dependency in composer.
3). Inherit the classes you intend to extend from abstract classes with namespace: namespace Umbrellio\Postgres\Extensions
4). Implement extension methods in closures, example:
5). Create Extension class and mix these methods using the following syntax, ex:
6). Register your Extension in ServiceProvider and put in config/app.php, ex:
TODO features
- Extend
CreateCommand
withinherits
andpartition by
- Extend working with partitions
- COPY support
- DISTINCT on specific columns
- INSERT ON CONFLICT support
- ...
License
Released under MIT License.
Authors
Created by Vitaliy Lazeev & Korben Dallas.
Contributing
- Fork it ( https://github.com/umbrellio/laravel-pg-extensions )
- Create your feature branch (
git checkout -b feature/my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin feature/my-new-feature
) - Create new Pull Request
All versions of laravel-pg-extensions with dependencies
php Version ^8.3|^8.4
doctrine/dbal Version 3.6.*
laravel/framework Version ^11.0