PHPackages                             socoladaica/laravel-table-prefix - 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. socoladaica/laravel-table-prefix

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

socoladaica/laravel-table-prefix
================================

Allows you to use a table prefix with standard Laravel models

1.2.0(3y ago)41.5k5MITPHPPHP ^7.4|^8.0CI passing

Since Mar 14Pushed 1mo ago2 watchersCompare

[ Source](https://github.com/SocolaDaiCa/laravel-table-prefix)[ Packagist](https://packagist.org/packages/socoladaica/laravel-table-prefix)[ Docs](https://github.com/socoladaica/laravel-table-prefix)[ GitHub Sponsors](https://github.com/sponsors/spatie)[ Fund](https://spatie.be/open-source/support-us)[ RSS](/packages/socoladaica-laravel-table-prefix/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (4)Versions (4)Used By (0)

Laravel Table Prefix
====================

[](#laravel-table-prefix)

[![Latest Version on Packagist](https://camo.githubusercontent.com/44d89ce6e73950168fd9cca19ce12455c02682c7d0819a37b8bc0bd56425d256/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f536f636f6c6164616963612f6c61726176656c2d7461626c652d7072656669782e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/Socoladaica/laravel-table-prefix)[![Build Status](https://camo.githubusercontent.com/add0b35acf45046be3c5fdc2ddcae7e8a960ea46470736798925dd1359abead2/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f536f636f6c6164616963612f6c61726176656c2d7461626c652d7072656669782f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/Socoladaica/laravel-table-prefix)[![GitHub Tests Action Status](https://camo.githubusercontent.com/75870e898a03a822bb555905c788d198d70024f8653710bf19d36e9c925ad202/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f536f636f6c6164616963612f6c61726176656c2d7461626c652d7072656669782f72756e2d74657374733f6c6162656c3d7465737473)](https://github.com/Socoladaica/laravel-table-prefix/actions?query=workflow%3Arun-tests+branch%3Amaster)[![Quality Score](https://camo.githubusercontent.com/df90a50e91a12637e9023c2e166df147cf05a8c1dc62f08df3eee3fd90efadf1/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f536f636f6c6164616963612f6c61726176656c2d7461626c652d7072656669782e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/Socoladaica/laravel-table-prefix)[![Total Downloads](https://camo.githubusercontent.com/b032266f17f7383017b26f0c279103b1108f7058f237fbae86e28ec7d6d8de47/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f536f636f6c6164616963612f6c61726176656c2d7461626c652d7072656669782e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/Socoladaica/laravel-table-prefix)

Allows you to use a table prefix with standard Laravel models.

Have inspiration from ideas [\[Proposal\] Prefixed Eloquent Models](https://github.com/laravel/ideas/issues/151)

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

[](#installation)

You can install the package via composer:

```
composer require socoladaica/laravel-table-prefix
```

Usage
-----

[](#usage)

Using it inside a `Post` model would look like this:

```
