PHPackages                             rapid/laplus - 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. rapid/laplus

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

rapid/laplus
============

Laravel Plus+

4.0.3(1y ago)217351[1 issues](https://github.com/rapidphp/laplus/issues)1MITPHP

Since Apr 19Pushed 1y ago1 watchersCompare

[ Source](https://github.com/rapidphp/laplus)[ Packagist](https://packagist.org/packages/rapid/laplus)[ RSS](/packages/rapid-laplus/feed)WikiDiscussions 4.x Synced yesterday

READMEChangelog (10)Dependencies (2)Versions (32)Used By (1)

Laplus ➕
========

[](#laplus-)

Laravel plus+ add presentation for your models

```
public function present()
{
    $this->id();
    $this->text('title');
    $this->string('password')->cast('hashed')->hidden();
    $this->belongsTo(Artist::class)->cascadeOnDelete();
}
```

What's Changed In V4
--------------------

[](#whats-changed-in-v4)

- Command names changed
- New development &amp; production deploy tools
- Removed slug and file columns
- Supports renames and changes a column at the same time
- Supports package resources
- Added travels ([read more...](doc/travel.md))
- Added validation generators ([read more...](doc/validation.md))

Features
--------

[](#features)

### 1. Migration Generating

[](#1-migration-generating)

Define the structure of your model: columns, indexes, data types, enums, relationships, or even extensibility with traits.

```
class Blog extends Model
{
    use HasPresent;
    use HasSlug; // Will extend the 'slug' column

    public function present(Present $present)
    {
        $present->id();
        $present->string('title');
        $present->belongsTo(Category::class);
        $present->enum('status', Status::class);
        $present->yield();
        $present->timestamps();
    }
}
```

Don't get involved in migrations! Because Laplus has taken responsibility for all migrations, and it builds all migrations by reading your presentations 😎

[Read more...](doc/dev.md)

### 2. Auto Fills

[](#2-auto-fills)

No need to redefine $fillable, $cast and $hidden! Defining it in the present specifies everything. So Laplus will autofill these variables. 😉

```
// These values will automatically fills:
// protected $fillable = ['id', 'slug'];
// protected $cast = ['password' => 'hashed'];
// protected $hidden = ['password'];
```

[Read more...](doc/present.md#fillable)

### 3. IDE Friendly

[](#3-ide-friendly)

When all the columns, their types, and their relationships are known, why shouldn't the IDE show them to us?

Laplus introduces all of this to the IDE by generating a neat (and out-of-model) document. 📝

```
/**
 * @property int $id
 * @property string $name
 * @property \App\Enums\Gender $gender
 * @method BelongsTo profile()
 * @property Profile $profile
 */
```

[Read more...](doc/guide.md)

### 4. Travels

[](#4-travels)

Once a version of the project has been deployed, it is almost impossible to change the database.

Travels allow you to make changes to the table records as well as change the table structure. ✈️

```
return new class extends Travel
{
    public string|array $on = User::class;
    public string|array $whenAdded = 'full_name';
    public string|array $prepareNullable = 'full_name';

    public function up(): void
    {
        User::all()->each(function (User $user) {
            $user->update([
                'full_name' => $user->first_name . ' ' . $user->last_name,
            ]);
        });
    }
};
```

In the above example, we are going to remove `first_name` and `last_name` from the users table and replace them with `full_name`.

The above class is responsible for generating the `full_name` value using the previous data before deleting `first_name` and `last_name`.

[Read more...](doc/travel.md)

Requirements
------------

[](#requirements)

- Php 8.2 or higher
- Laravel 11.0

Documents
---------

[](#documents)

- [Installation](doc/installation.md)
- [Configuration](doc/configuration.md)
- [Present](doc/present.md)
- [Dev Utils](doc/dev.md)
- [Deploy](doc/deploy.md)
- [Label](doc/label.md)
- [Guide](doc/guide.md)
- [Travel](doc/travel.md)
- [Package Development](doc/package-development.md)
- [Validation Generator](doc/validation.md)

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

[](#installation)

### 1- Install the package with composer:

[](#1--install-the-package-with-composer)

```
composer require rapid/laplus
```

### 2- Publish configs (Optional)

[](#2--publish-configs-optional)

Run this command to publish configs to `config/laplus.php`

```
php artisan vendor:publish --tag=laplus
```

### 3- Convert default User model to presentable model (Optional):

[](#3--convert-default-user-model-to-presentable-model-optional)

- Add `HasPresent` trait:

```
class User extends Model
{
    use HasPresent;
}
```

- Remove `$fillable`, `$hidden` and `casts()` values:

```
//protected $fillable = ['name', 'email', 'password'];
//protected $hidden = ['password', 'remember_token'];
//protected function casts() { ... }
```

> Laplus will automatically add this values.

Add below code in User class:

```
protected function present(Present $present)
{
    $present->id();
    $present->string('name');
    $present->string('email')->unique();
    $present->timestamp('email_verified_at')->nullable();
    $present->password();
    $present->rememberToken();
    $present->timestamps();
}
```

- Move default migration to laplus path:

Find `database/migrations/0001_01_01_000000_create_users_table.php` file and move it into `database/migrations/deploy` folder (create it if doesn't exists)

Development Utils
-----------------

[](#development-utils)

To be able to update your tables during development, you can use the following command:

```
php artisan dev:migrate --guide
```

[Read more...](doc/dev.md)

Deployment
----------

[](#deployment)

When deploying the project to production, you can create the final migrations with the following command:

```
php artisan deploy:migrate
```

> For greater project safety, you can follow the scenario we have written on the page below.

[Read more...](doc/deploy.md)

Make model
----------

[](#make-model)

You can use this command to create a model and a present:

```
php artisan make:model-laplus Name
```

This command will create `app/Models/Name.php` with inline presentation.

[Read more...](doc/present.md#make-presentable-model)

Make model with separately present
----------------------------------

[](#make-model-with-separately-present)

You can use this command to create a model with present class:

```
php artisan make:model-laplus --present Name
```

This command will create `app/Models/Name.php` model and `app/Presents/NamePresent.php` present.

[Read more...](doc/present.md#separately-present)

Migrations
----------

[](#migrations)

### Generate Migrations

[](#generate-migrations)

Run this command to automatically found the updates and generate migrations:

```
php artisan dev:migration
```

[Read more...](doc/dev.md)

### Update Database

[](#update-database)

Following command, run `dev:migration` and `migrate` at once:

```
php artisan dev:migrate
```

[Read more...](doc/dev)

Label Translator
----------------

[](#label-translator)

Present the model labels:

```
class UserLabelTranslator extends LabelTranslator
{
    public function gender(bool $emoji = false)
    {
        return $this->value?->toString($emoji); // Returns gender name or null
    }
}
```

And use it easily:

```
{{ $user->gender_label }}
{{ $user->gender_label(emoji: true) }}
```

> Labels always return a string value. If the value is null, it returns `"Undefined"`.

[Read more...](doc/label.md)

Guide Generator
---------------

[](#guide-generator)

Guide automatically generate the model docblock using the columns, attributes and relationships:

```
class User extends Model
{
    use HasPresent;
    use HasLabels;

    protected function present(Present $present)
    {
        $present->id();
        $present->string('name');
    }

    #[IsRelation]
    public function avatars()
    {
        return $this->hasMany(Avatar::class);
    }

    public function getFirstName() : string
    {
        return Str::before($this->name, ' ');
    }
}
```

It generates:

```
/**
 * @Guide
 * @property int $id
 * @property string $name
 * @property Collection $avatars
 * @property string $name_label
 * @property string name_label()
 * @property string $first_name
 * @EndGuide
 */
class User extends Model
```

[Read more...](doc/guide.md)

More Document
-------------

[](#more-document)

**More document found in [Documents](#documents) section.**

###  Health Score

35

—

LowBetter than 77% of packages

Maintenance42

Moderate activity, may be stable

Popularity25

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity52

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.

###  Release Activity

Cadence

Every ~12 days

Recently: every ~2 days

Total

29

Last Release

448d ago

Major Versions

1.4.2 → 2.0.02024-10-01

2.1.1 → 3.0.02024-11-19

2.x-dev → 3.0.12024-11-22

3.x-dev → 4.0.02025-04-01

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/95860107?v=4)[Mahdi Saremi](/maintainers/MahdiSaremi)[@MahdiSaremi](https://github.com/MahdiSaremi)

---

Top Contributors

[![MahdiSaremi](https://avatars.githubusercontent.com/u/95860107?v=4)](https://github.com/MahdiSaremi "MahdiSaremi (155 commits)")

---

Tags

databaselaravelmigrations

### Embed Badge

![Health badge](/badges/rapid-laplus/health.svg)

```
[![Health](https://phpackages.com/badges/rapid-laplus/health.svg)](https://phpackages.com/packages/rapid-laplus)
```

###  Alternatives

[anourvalar/eloquent-serialize

Laravel Query Builder (Eloquent) serialization

11223.5M33](/packages/anourvalar-eloquent-serialize)[statamic-rad-pack/runway

Eloquently manage your database models in Statamic.

135224.7k7](/packages/statamic-rad-pack-runway)[ecotone/laravel

Ecotone for Laravel — CQRS, Event Sourcing, Sagas, Durable Workflows, and Outbox on top of Laravel Queue, via PHP attributes.

21318.6k3](/packages/ecotone-laravel)

PHPackages © 2026

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