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 3w ago

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 21% 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://avatars.githubusercontent.com/u/110610?v=4)[Elton Luis Kolling](/maintainers/eltonlk)[@eltonlk](https://github.com/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

[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k117.2M117](/packages/jdorn-sql-formatter)[propel/propel1

Propel is an open-source Object-Relational Mapping (ORM) for PHP5.

8351.6M87](/packages/propel-propel1)[pgvector/pgvector

pgvector support for PHP

198741.5k11](/packages/pgvector-pgvector)[jfelder/oracledb

Oracle DB driver for Laravel

11518.4k](/packages/jfelder-oracledb)

PHPackages © 2026

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