simo46 / laravel-postgresql-inherit
Add inheritance in postgresql tables
Installs: 7
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 10
pkg:composer/simo46/laravel-postgresql-inherit
Requires
- php: >=8.0
- illuminate/database: ^9.13
- illuminate/support: ^9.5
Requires (Dev)
- mockery/mockery: ^1.5
- phpunit/phpunit: ^9.5.15
This package is not auto-updated.
Last update: 2026-01-02 01:52:02 UTC
README
Add inheritance in postgresql tables
Installation
PHP 7.2+ and Laravel 7.x are required.
For Laravel Versions 5.2.* & 5.3.*, run the following command to install this package via composer
composer require "rishi-ramawat/laravel-postgresql-inherit ~2.1.0"
For Laravel Versions 5.4+, run the following command to install this package via composer
composer require "rishi-ramawat/laravel-postgresql-inherit ~2.2"
For Laravel Versions 7.x, run the following command to install this package via composer
composer require "rishi-ramawat/laravel-postgresql-inherit ~2.4"
For Laravel Versions 8.x, run the following command to install this package via composer
composer require "rishi-ramawat/laravel-postgresql-inherit ~2.6"
Once PostgreSQL Schema is installed, you need to register the service provider. Open up config/app.php and add the following to the providers array.
RishiRamawat\PostgresSchema\PostgresqlSchemaServiceProvider::class,
Usage
In migration file when using a postgresql database, you can use the new method inherits():
Schema::create('cities', function(Blueprint $table) { $table->increments('id'); $table->string('name'); $table->double('population'); $table->integer('altitude')->comment('In Feet'); }); Schema::create('capitals', function(Blueprint $table) { $table->string('state'); // Make capitals table inherits all the columns of its parent table, cities $table->inherits('cities'); });