PHPackages                             datarose/illuminate-blueprint-recall - 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. datarose/illuminate-blueprint-recall

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

datarose/illuminate-blueprint-recall
====================================

Blueprint macro for Laravel to restore column attribute persistence in migrations. Update only what you need. (Unofficial)

0.1.0(3mo ago)00AGPL-3.0-onlyPHPPHP ^8.2|^8.3|^8.4|^8.5

Since Apr 24Pushed 3mo agoCompare

[ Source](https://github.com/datarose-dev/illuminate-blueprint-recall)[ Packagist](https://packagist.org/packages/datarose/illuminate-blueprint-recall)[ Docs](https://github.com/datarose-net/illuminate-blueprint-recall)[ RSS](/packages/datarose-illuminate-blueprint-recall/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (1)Dependencies (5)Versions (2)Used By (0)

datarose/illuminate-blueprint-recall
====================================

[](#dataroseilluminate-blueprint-recall)

`datarose/illuminate-blueprint-recall` is an unofficial Laravel package that restores column attribute persistence when changing existing columns in migrations.

It adds a `column()` macro to Laravel's `Blueprint`, allowing you to update only the attributes you actually want to change.

```
Schema::table('users', function (Blueprint $table) {
    $table->column('votes')->nullable();
});
```

Instead of repeating the full column definition:

```
Schema::table('users', function (Blueprint $table) {
    $table->integer('votes')
        ->unsigned()
        ->default(1)
        ->comment('The vote count')
        ->nullable()
        ->change();
});
```

- [Why this exists](#why-this-exists)
- [Get started](#get-started)
- [Usage](#usage)
- [How it works](#how-it-works)
- [IDE support](#ide-support)
- [Limitations](#limitations)
- [Testing](#testing)
- [Contributing](#contributing)

Why this exists
---------------

[](#why-this-exists)

Starting with Laravel 11, modifying a column requires redefining all existing attributes of that column. If an attribute is not explicitly included in the migration, Laravel may drop it.

For example, given this original column:

```
Schema::create('users', function (Blueprint $table) {
    $table->integer('votes')
        ->unsigned()
        ->default(1)
        ->comment('The vote count');
});
```

This Laravel 11+ migration only makes the column nullable, but may drop the previous `unsigned`, `default`, and `comment` attributes:

```
Schema::table('users', function (Blueprint $table) {
    $table->integer('votes')->nullable()->change();
});
```

Laravel now expects the full definition:

```
Schema::table('users', function (Blueprint $table) {
    $table->integer('votes')
        ->unsigned()
        ->default(1)
        ->comment('The vote count')
        ->nullable()
        ->change();
});
```

`datarose/illuminate-blueprint-recall` avoids this repetition by reading the current column definition from the database and applying the existing attributes automatically.

Get started
-----------

[](#get-started)

Install the package with Composer:

```
composer require datarose/illuminate-blueprint-recall
```

Laravel package auto-discovery will register the service provider automatically.

If you do not use auto-discovery, register the provider manually:

```
Datarose\BlueprintRecall\BlueprintRecallServiceProvider::class
```

Usage
-----

[](#usage)

Use `column()` when you want to change an existing column while keeping its current attributes.

### Make a column nullable

[](#make-a-column-nullable)

```
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

Schema::table('users', function (Blueprint $table) {
    $table->column('votes')->nullable();
});
```

The package recalls the existing column type and attributes, then applies only the new change.

### Remove nullable

[](#remove-nullable)

```
Schema::table('users', function (Blueprint $table) {
    $table->column('votes')->nullable(false);
});
```

### Change multiple attributes

[](#change-multiple-attributes)

```
Schema::table('users', function (Blueprint $table) {
    $table->column('votes')
        ->nullable()
        ->default(0);
});
```

### Keep the original type

[](#keep-the-original-type)

You do not need to specify whether the column is an integer, string, text, decimal, or another supported type.

```
Schema::table('users', function (Blueprint $table) {
    $table->column('email')->nullable();
});
```

The package resolves the existing database column and builds the matching Laravel column definition before calling `change()`.

How it works
------------

[](#how-it-works)

The package registers a `column()` macro on Laravel's `Illuminate\Database\Schema\Blueprint`.

When called, it:

1. Reads the current table name from the active `Blueprint`.
2. Loads the table columns from the database schema.
3. Finds the requested column.
4. Converts the database column type back to a Laravel Blueprint type.
5. Re-applies existing attributes such as:
    - nullable
    - default value
    - unsigned
    - auto increment
    - comment
6. Returns the column definition with `change()` already applied.

This lets your migration focus on the change you actually want to make.

```
$table->column('votes')->nullable();
```

IDE support
-----------

[](#ide-support)

The package includes an optional IDE helper file for macro autocomplete.

It documents the added `column()` method on `Blueprint` and boolean-capable column modifiers such as:

```
$definition->autoIncrement(false);
$definition->unsigned(false);
```

If your IDE does not pick it up automatically, make sure Composer dev autoload files are loaded:

```
composer dump-autoload
```

Limitations
-----------

[](#limitations)

This package is intentionally focused on Laravel migration ergonomics and depends on the database schema information available through Laravel.

Some column types, database drivers, generated columns, indexes, or platform-specific attributes may require additional handling.

The package is unofficial and not maintained by the Laravel framework team.

Testing
-------

[](#testing)

```
composer install
composer test
```

or directly:

```
./vendor/bin/pest
```

Contributing
------------

[](#contributing)

Contributions are welcome.

To work on the package locally:

```
git clone https://github.com/datarose-net/illuminate-blueprint-recall.git
cd illuminate-blueprint-recall
composer install
composer test
```

License &amp; Acknowledgments
-----------------------------

[](#license--acknowledgments)

This project is open source and released under the [GNU Affero General Public License v3.0 (AGPL-3.0)](https://www.gnu.org/licenses/agpl-3.0.html).

This package was created to make Laravel 11+ column migrations easier to maintain when changing existing columns.

Laravel is a trademark of Taylor Otwell. This package is unofficial and is not affiliated with or endorsed by Laravel or Taylor Otwell.

Copyright (C) 2020—present [Zoltán Rózsa](https://github.com/rozsazoltan) &amp; [Datarose](https://github.com/datarose-net)

###  Health Score

34

—

LowBetter than 75% of packages

Maintenance82

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community6

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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

91d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/67325669?v=4)[Rózsa Zoltán](/maintainers/rozsazoltan)[@rozsazoltan](https://github.com/rozsazoltan)

---

Top Contributors

[![rozsazoltan](https://avatars.githubusercontent.com/u/67325669?v=4)](https://github.com/rozsazoltan "rozsazoltan (5 commits)")

---

Tags

blueprintdatabasedatabase-schemailluminatelaravellaravel-migrationlaravel-schemaphplaravelmigrationblueprintchangepreserverecall

###  Code Quality

TestsPest

Static AnalysisRector

### Embed Badge

![Health badge](/badges/datarose-illuminate-blueprint-recall/health.svg)

```
[![Health](https://phpackages.com/badges/datarose-illuminate-blueprint-recall/health.svg)](https://phpackages.com/packages/datarose-illuminate-blueprint-recall)
```

###  Alternatives

[illuminate/database

The Illuminate Database package.

2.8k54.9M12.2k](/packages/illuminate-database)[bavix/laravel-wallet

It's easy to work with a virtual wallet.

1.3k1.3M19](/packages/bavix-laravel-wallet)[wnx/laravel-backup-restore

A package to restore database backups made with spatie/laravel-backup.

213427.0k2](/packages/wnx-laravel-backup-restore)[cybercog/laravel-clickhouse

ClickHouse migrations for Laravel

166251.3k1](/packages/cybercog-laravel-clickhouse)[lacodix/laravel-model-filter

A Laravel package to filter, search and sort models with ease while fetching from database.

17558.6k](/packages/lacodix-laravel-model-filter)[giacomomasseron/laravel-models-generator

Generate Laravel models from an existing database

557.9k](/packages/giacomomasseron-laravel-models-generator)

PHPackages © 2026

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