PHPackages                             eltonlk/laravel-pg-schemas - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. eltonlk/laravel-pg-schemas

ActiveLibrary[Database &amp; ORM](/categories/database)

eltonlk/laravel-pg-schemas
==========================

Laravel package for managing postgres schemas.

299PHP

Since Jul 25Pushed 11y ago4 watchersCompare

[ Source](https://github.com/eltonlk/laravel-pg-schemas)[ Packagist](https://packagist.org/packages/eltonlk/laravel-pg-schemas)[ RSS](/packages/eltonlk-laravel-pg-schemas/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (1)Used By (0)

Laravel PGSchema
================

[](#laravel-pgschema)

[![Code Climate](https://camo.githubusercontent.com/6dc85012a90312f0cc6ce8d213feca4add223bbbdb7b7447f88304e0b4672667/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f656c746f6e6c6b2f6c61726176656c2d70672d736368656d61732e706e67)](https://codeclimate.com/github/eltonlk/laravel-pg-schemas)

With this package you can create, switch and drop postgres schemas.

Installation
------------

[](#installation)

Add the following to your `composer.json`:

```
"eltonlk/laravel-pg-schemas": "dev-master"

```

Add to your app.php file in the services providers section.

```
'providers' => array(
    ...

    'Eltonlk\LaravelPgSchemas\LaravelPgSchemasServiceProvider'
)

```

Usage
-----

[](#usage)

Assuming that you have your db configuration ready, meaning that your default connection is 'pgsql' and your pgsql credentials are setted in the usual way, you can use the next functions:

### Create new Schema

[](#create-new-schema)

```
PGSchema::create($schemaName);

```

### Switch to Schema

[](#switch-to-schema)

if switchTo is call without arguments, it switches to the public schema (default)

```
PGSchema::switchTo($schemaName);

```

### Drop Schema

[](#drop-schema)

```
PGSchema::drop($schemaName);

```

### Migrate Schema

[](#migrate-schema)

```
PGSchema::migrate($schemaName);

```

You can also tell which database connection.

```
PGSchema::migrate($schemaName, ['--database' => 'pgsql2']);

```

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/da8058141affb5602085c5dd5cf2059537db03adb3c1c62ed4d54b7b7e51543a?d=identicon)[eltonlk](/maintainers/eltonlk)

---

Top Contributors

[![eltonlk](https://avatars.githubusercontent.com/u/110610?v=4)](https://github.com/eltonlk "eltonlk (2 commits)")

### Embed Badge

![Health badge](/badges/eltonlk-laravel-pg-schemas/health.svg)

```
[![Health](https://phpackages.com/badges/eltonlk-laravel-pg-schemas/health.svg)](https://phpackages.com/packages/eltonlk-laravel-pg-schemas)
```

###  Alternatives

[doctrine/orm

Object-Relational-Mapper for PHP

10.2k285.3M6.2k](/packages/doctrine-orm)[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k115.1M102](/packages/jdorn-sql-formatter)[illuminate/database

The Illuminate Database package.

2.8k52.4M9.4k](/packages/illuminate-database)[mongodb/mongodb

MongoDB driver library

1.6k64.0M546](/packages/mongodb-mongodb)[ramsey/uuid-doctrine

Use ramsey/uuid as a Doctrine field type.

90340.3M211](/packages/ramsey-uuid-doctrine)[reliese/laravel

Reliese Components for Laravel Framework code generation.

1.7k3.4M16](/packages/reliese-laravel)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
