PHPackages                             muzammal/syncmodelfillable - 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. muzammal/syncmodelfillable

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

muzammal/syncmodelfillable
==========================

A Laravel package to synchronize model fillable fields with migration columns using commands

1.5.0(1y ago)12711MITPHPPHP &gt;=7.4

Since Nov 7Pushed 6mo ago1 watchersCompare

[ Source](https://github.com/Muzammal01/syncmodelfillable)[ Packagist](https://packagist.org/packages/muzammal/syncmodelfillable)[ RSS](/packages/muzammal-syncmodelfillable/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (4)Versions (10)Used By (0)

SyncModelFillable
=================

[](#syncmodelfillable)

[![Latest Version on Packagist](https://camo.githubusercontent.com/d78fb9baddbd43416d7600078e55423ea797323ddde2f2bf31ad055d31d1dada/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d757a616d6d616c2f73796e636d6f64656c66696c6c61626c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/muzammal/syncmodelfillable)[![Total Downloads](https://camo.githubusercontent.com/a25f0b09c19df1d5c10d9f33e5b930d5e4adadc6474fe5df37e2367daee44b6b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d757a616d6d616c2f73796e636d6f64656c66696c6c61626c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/muzammal/syncmodelfillable)

**SyncModelFillable** is a Laravel package designed to help automatically add or update a model's `$fillable` fields with its database migration columns. 🎉 With just a simple Artisan command.

✨ Features
----------

[](#-features)

- 🛠️ Syncs model `$fillable` properties with migration columns.
- 📦 Supports Laravel versions 8, 9, 10, 11, and 12.
- ⚙️ Customizable to exclude specific columns, like timestamps.
- 🔄 **New:**
    - The `all` flag now **recursively scans all subdirectories** inside `app/Models/`.
    - The `--path=` option allows selecting a **custom directory** for scanning models.
    - The `--ignore` flag lets you exclude specific models during sync.
    - 🧹 **Cross-platform Pint support:** Automatically formats the model file after updating the `$fillable` fields, ensuring proper code formatting on all operating systems (Windows, macOS, Linux).

---

🚀 Installation
--------------

[](#-installation)

1. **Install the package via Composer:**

    ```
    composer require muzammal/syncmodelfillable
    ```
2. **(Optional) Publish the configuration file:**

    ```
    php artisan vendor:publish --tag=syncmodelfillable-config
    ```

    This will create a `config/syncfillable.php` file where you can specify columns to exclude (such as `created_at`, `updated_at`, `deleted_at`, etc.).

---

📘 Usage
-------

[](#-usage)

This package provides an Artisan command `sync:fillable` to sync a model's `$fillable` fields with its database migration columns.

### 🔹 Sync a Specific Model

[](#-sync-a-specific-model)

To sync the `$fillable` fields of a specific model inside `app/Models/`, including nested folders run this:

```
php artisan sync:fillable Post
```

### 🔹 Sync All Models (Including Nested Folders)

[](#-sync-all-models-including-nested-folders)

To sync all models inside `app/Models/`, including nested folders:

```
php artisan sync:fillable all
```

This will:

- Scan **all subdirectories** inside `app/Models/` (e.g., `app/Models/Fintech/AnotherFolder/AnotherFolder`).
- Match each model with its migration file.
- generate the `$fillable` properties accordingly.

### 🔹 **New:** Custom Path for Models

[](#-new-custom-path-for-models)

You can specify a custom path instead of using `app/Models/` by using the `--path=` option.

```
php artisan sync:fillable --path=app/CustomModels
```

This will:

- Scan **app/CustomModels/** instead of `app/Models/`.
- Sync all models found in that directory.

### 🔹 **New:** Exclude Models with the `--ignore` Flag

[](#-new-exclude-models-with-the---ignore-flag)

To exclude specific models from the sync operation:

```
php artisan sync:fillable all --ignore=User
```

You can also pass multiple models:

```
php artisan sync:fillable all --ignore=User,Product,Order
```

If syncing a single model, the `--ignore` flag is not applicable:

```
php artisan sync:fillable Product
```

---

⚙️ Configuration
----------------

[](#️-configuration)

The configuration file `syncfillable.php` allows you to exclude certain columns from `$fillable`. By default, common timestamp columns (`created_at`, `updated_at`, `deleted_at`) are excluded.

**Example configuration:**

```
return [
    'excluded_columns' => ['created_at', 'updated_at', 'deleted_at'],
];
```

---

🧹 **Cross-Platform Support for Pint**
-------------------------------------

[](#-cross-platform-support-for-pint)

After updating the `$fillable` fields, the model file will be automatically formatted using [Pint](https://github.com/laravel/pint). This ensures that your code is properly formatted on all operating systems, including Windows, macOS, and Linux.

- On **Windows**, Pint is run via `vendor\\bin\\pint.bat`.
- On **macOS/Linux**, Pint is executed with `./vendor/bin/pint`.

This ensures your code maintains consistency and adheres to best practices without requiring manual formatting. ✨

---

🔍 Example
---------

[](#-example)

If your `Post` model has a migration defining `name`, `slug`, and `content` columns, running:

```
php artisan sync:fillable Post
```

Would automatically generate `$fillable` in `Post.php`

```
protected $fillable = ['name', 'slug', 'content'];
```

Additionally, after updating the `$fillable` fields, the `Post.php` file will be formatted to ensure clean code.

---

📜 License
---------

[](#-license)

This package is open-source software licensed under the MIT license.

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance58

Moderate activity, may be stable

Popularity18

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity44

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 ~58 days

Recently: every ~52 days

Total

7

Last Release

202d ago

Major Versions

1.5.0 → v2.x-dev2025-10-20

### Community

Maintainers

![](https://www.gravatar.com/avatar/93006595060e0e69846ac44f8d281496a608089cdc52d0925de0b64d1af785a6?d=identicon)[Muzammal01](/maintainers/Muzammal01)

---

Top Contributors

[![Muzammal01](https://avatars.githubusercontent.com/u/108214520?v=4)](https://github.com/Muzammal01 "Muzammal01 (43 commits)")

---

Tags

artisandatabasefillablelaravellaravel-10laravel-11laravel-8laravel-9laravel-developmentlaravel-packagemigrationmodelpackagephpsync

### Embed Badge

![Health badge](/badges/muzammal-syncmodelfillable/health.svg)

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

###  Alternatives

[spatie/laravel-backup

A Laravel package to backup your application

6.0k21.8M188](/packages/spatie-laravel-backup)[tucker-eric/eloquentfilter

An Eloquent way to filter Eloquent Models

1.8k4.8M26](/packages/tucker-eric-eloquentfilter)[cybercog/laravel-clickhouse

ClickHouse migrations for Laravel

163166.8k](/packages/cybercog-laravel-clickhouse)[clickbar/laravel-magellan

This package provides functionality for working with the postgis extension in Laravel.

423715.4k1](/packages/clickbar-laravel-magellan)[toponepercent/baum

Baum is an implementation of the Nested Set pattern for Eloquent models.

3154.7k](/packages/toponepercent-baum)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

255.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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