Looking to hire Laravel developers? Try LaraJobs

laravel-crud-generator maintained by muhammadsami

Description
Laravel CRUD Generator using Repository Pattern by Muhammad Sami
Last update
2026/11/28 09:55 (dev-main)
License
Links
Downloads
15

Comments
comments powered by Disqus

Laravel CRUD Generator

Packagist Version License Stars

Generate Laravel CRUD boilerplate using the Repository Pattern — in seconds.
Built with by Muhammad Sami

Uploading image.png…


✨ Features

  • 🔧 Generates: Model, Migration, Form Request, Controller
  • 💡 Repository & Interface Pattern
  • ⚙️ Artisan Command Based
  • 🧱 PSR-4 Autoloaded Structure
  • ✏️ Stubs Fully Customizable
  • 🧼 Clean, Scalable & Maintainable Code

📦 Installation

Install via Composer:

composer require muhammadsami/laravel-crud-generator


2. Publish stub files:

php artisan vendor:publish --tag=crud-stubs


⚡ Usage
Run the command to scaffold a full CRUD:


php artisan make:crud Product

This will generate:

app/Models/Product.php

app/Http/Requests/ProductRequest.php

app/Interfaces/ProductInterface.php

app/Repositories/ProductRepository.php

app/Http/Controllers/Api/ProductController.php

database/migrations/xxxx_xx_xx_xxxxxx_create_products_table.php

🛠 Configuration Steps

1. Bind Interface to Repository
Update AppServiceProvider:


public function register()
{
    $this->app->bind(
        \App\Interfaces\ProductInterface::class,
        \App\Repositories\ProductRepository::class
    );
}
3. Define Routes
In routes/api.php:

//Example
use App\Http\Controllers\Api\ProductController;

Route::apiResource('products', ProductController::class);

4. Customize Migration
You can modify the generated migration file before running:

php artisan migrate