PHPackages                             ashique-ar/laravel-crud-generator - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. ashique-ar/laravel-crud-generator

ActiveLibrary[HTTP &amp; Networking](/categories/http)

ashique-ar/laravel-crud-generator
=================================

A powerful, configuration-driven CRUD API generator for Laravel with advanced features including permissions, filtering, sorting, bulk operations, and custom logic handlers.

1.0.1.0(11mo ago)141MITPHPPHP ^8.1

Since Jul 11Pushed 11mo agoCompare

[ Source](https://github.com/ashique-ar/laravel-crud-generator)[ Packagist](https://packagist.org/packages/ashique-ar/laravel-crud-generator)[ Docs](https://github.com/ashique-ar/laravel-crud-generator)[ RSS](/packages/ashique-ar-laravel-crud-generator/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (6)Versions (3)Used By (0)

Laravel CRUD Generator
======================

[](#laravel-crud-generator)

[![Latest Version on Packagist](https://camo.githubusercontent.com/f815ed34c22b716b6dec126668eba787d2d5c4b64f67e4ab1d07fb289f618dd7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f617368697175652d61722f6c61726176656c2d637275642d67656e657261746f722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/ashique-ar/laravel-crud-generator)[![GitHub Tests Action Status](https://camo.githubusercontent.com/80ca07ce2b57143625d8b3ea27b322b8c850875dbd887f6adca9387eac3f8989/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f617368697175652d61722f6c61726176656c2d637275642d67656e657261746f722f72756e2d74657374733f6c6162656c3d7465737473)](https://github.com/ashique-ar/laravel-crud-generator/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/a93297d17a647db65654893084dbc90faeabc595b33f022b9c9a1f68bc4caef1/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f617368697175652d61722f6c61726176656c2d637275642d67656e657261746f722f436865636b253230262532306669782532307374796c696e673f6c6162656c3d636f64652532307374796c65)](https://github.com/ashique-ar/laravel-crud-generator/actions?query=workflow%3A%22Check+%26+fix+styling%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/ae5a7573da029b1cf33c45b7cae6556ece979e64ac6a7ada0b4eea1514962f29/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f617368697175652d61722f6c61726176656c2d637275642d67656e657261746f722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/ashique-ar/laravel-crud-generator)

A powerful, configuration-driven CRUD API generator for Laravel applications. Generate complete REST APIs with advanced features like permissions, filtering, sorting, validation, relations management, and custom business logic handlers - all through simple configuration.

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

[](#-features)

- **🚀 Zero-Code CRUD APIs** - Generate complete REST APIs through configuration
- **� Advanced Relations Management** - Dynamic form relations with dependent dropdowns
- **�🔐 Permission Integration** - Built-in support for Spatie Laravel Permission
- **🎯 Custom Logic Handlers** - Extend with custom business logic easily
- **🔍 Advanced Filtering** - Search across multiple fields with configurable operators
- **📊 Smart Sorting** - Multi-field sorting with default configurations
- **⚡ Bulk Operations** - Perform operations on multiple resources at once
- **🗑️ Soft Deletes Support** - Full soft delete support with restore capabilities
- **✅ Automatic Validation** - Validation rules defined in configuration
- **📚 API Documentation** - Auto-generated OpenAPI/Swagger documentation
- **🛠️ Artisan Commands** - Powerful commands for scaffolding and management
- **🧪 Fully Tested** - Comprehensive test suite included

📋 Requirements
--------------

[](#-requirements)

- PHP 8.1+
- Laravel 10.x | 11.x | 12.x
- Spatie Laravel Permission (automatically installed)

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

[](#-installation)

Install the package via Composer:

```
composer require ashique-ar/laravel-crud-generator
```

Run the installation command:

```
php artisan crud:install
```

This will:

- Publish the configuration file
- Set up middleware
- Register routes
- Generate initial permissions (optional)

🚀 Quick Start
-------------

[](#-quick-start)

### 1. Generate Your First Resource

[](#1-generate-your-first-resource)

Use the artisan command to quickly scaffold a new resource:

```
# Generate a basic resource
php artisan make:crud-resource users --model=App\\Models\\User

# Generate with additional options
php artisan make:crud-resource posts --model=App\\Models\\Post --logic --resource --permissions
```

### 2. Configure Relations (New!)

[](#2-configure-relations-new)

Add relations to enable dynamic form management:

```
# Interactive mode to configure relations
php artisan crud:relations posts --interactive

# Add specific relations
php artisan crud:relations posts --field=category_id --entity=categories --type=single --searchable
```

### 3. Example Resource Configuration

[](#3-example-resource-configuration)

Here's a complete example of a resource with relations in `config/crud.php`:

```
