PHPackages                             aesen/laravel-auto-request - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. aesen/laravel-auto-request

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

aesen/laravel-auto-request
==========================

Automatically generate Laravel FormRequest classes from migrations

v1.0.0(4mo ago)01MITPHPPHP ^8.1|^8.2|^8.3

Since Jan 2Pushed 4mo agoCompare

[ Source](https://github.com/AbdullahEminEsen/laravel-auto-request)[ Packagist](https://packagist.org/packages/aesen/laravel-auto-request)[ RSS](/packages/aesen-laravel-auto-request/feed)WikiDiscussions main Synced 1mo ago

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

Laravel Auto Request
====================

[](#laravel-auto-request)

Automatically generate **Laravel FormRequest** classes (`Store` &amp; `Update`) directly from your **database migrations**.

This package helps you eliminate repetitive boilerplate by reading migration definitions and converting them into validation rules and messages.

---

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

[](#-features)

- Generate **Store** and **Update** FormRequest classes
- Parse rules directly from migrations
- Automatically detects:

    - `required` / `nullable`
    - `string`, `text`, `boolean`, `integer`
    - `foreignId` → `exists`
    - `unique`
- Update requests automatically use `sometimes`
- Configurable validation language (`tr`, `en`)
- Customizable validation messages
- Overwrite protection
- Artisan command support

---

📦 Installation
--------------

[](#-installation)

```
composer require aesen/laravel-auto-request
```

Laravel will auto-discover the service provider.

---

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

[](#️-configuration)

Publish the config file:

```
php artisan vendor:publish --tag=auto-request-config
```

This will create:

```
config/auto-request.php
```

### Available Options

[](#available-options)

```
return [
    'language' => 'tr',

    'rules' => [
        'store' => [
            'required' => true,
        ],
        'update' => [
            'use_sometimes' => true,
        ],
    ],

    'messages' => [
        'tr' => [
            'required' => ':attribute alanı zorunludur.',
            'unique'   => ':attribute daha önce kullanılmış.',
            'exists'   => ':attribute geçerli değil.',
        ],
        'en' => [
            'required' => ':attribute is required.',
            'unique'   => ':attribute has already been taken.',
            'exists'   => ':attribute is invalid.',
        ],
    ],
];
```

---

🚀 Usage
-------

[](#-usage)

Generate both Store &amp; Update requests:

```
php artisan make:auto-request Post
```

Generate only Store request:

```
php artisan make:auto-request Post --only=store
```

Generate only Update request:

```
php artisan make:auto-request Post --only=update
```

Generated files:

```
app/Http/Requests/Post/
├── StorePostRequest.php
└── UpdatePostRequest.php

```

---

🧠 How It Works
--------------

[](#-how-it-works)

The package scans the model's **create table migration** and converts column definitions into validation rules.

### Example Migration

[](#example-migration)

```
$table->string('title')->unique();
$table->text('body');
$table->foreignId('category_id');
$table->boolean('active')->nullable();
```

### Generated Rules (Store)

[](#generated-rules-store)

```
'title' => ['required', 'string', 'unique:posts,title'],
'body' => ['required', 'string'],
'category_id' => ['required', 'integer', 'exists:categories,id'],
'active' => ['nullable', 'boolean'],
```

### Generated Rules (Update)

[](#generated-rules-update)

```
'title' => ['sometimes', 'string', 'unique:posts,title,$this->route("id")'],
'body' => ['sometimes', 'string'],
'category_id' => ['sometimes', 'integer', 'exists:categories,id'],
'active' => ['nullable', 'boolean'],
```

---

🌍 Validation Messages
---------------------

[](#-validation-messages)

Messages are generated automatically using the selected language.

Example (`tr`):

```
'title.required' => 'Title alanı zorunludur.',
'title.unique'   => 'Title daha önce kullanılmış.',
```

---

🛣 Roadmap
---------

[](#-roadmap)

- Index-based unique detection
- Model fillable fallback
- Attribute translations
- Column comment parsing
- Custom rule presets

---

🧑‍💻 Author
----------

[](#‍-author)

**Abdullah Emin Esen**GitHub:

---

📄 License
---------

[](#-license)

MIT License

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance77

Regular maintenance activity

Popularity1

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity49

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

128d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/fe339cce82be226790b70cbb44ffa5292581ad720271470dca12e07227b103b6?d=identicon)[Abdullah Esen](/maintainers/Abdullah%20Esen)

---

Top Contributors

[![AbdullahEminEsen](https://avatars.githubusercontent.com/u/106411700?v=4)](https://github.com/AbdullahEminEsen "AbdullahEminEsen (1 commits)")

### Embed Badge

![Health badge](/badges/aesen-laravel-auto-request/health.svg)

```
[![Health](https://phpackages.com/badges/aesen-laravel-auto-request/health.svg)](https://phpackages.com/packages/aesen-laravel-auto-request)
```

###  Alternatives

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M686](/packages/barryvdh-laravel-ide-helper)[orchestra/canvas

Code Generators for Laravel Applications and Packages

21017.2M157](/packages/orchestra-canvas)[illuminate/pipeline

The Illuminate Pipeline package.

9446.6M211](/packages/illuminate-pipeline)[illuminate/pagination

The Illuminate Pagination package.

10532.5M862](/packages/illuminate-pagination)[spatie/laravel-pjax

A pjax middleware for Laravel 5

513371.8k11](/packages/spatie-laravel-pjax)[spatie/laravel-mix-preload

Add preload and prefetch links based your Mix manifest

169176.0k2](/packages/spatie-laravel-mix-preload)

PHPackages © 2026

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