LaravelPackages.net
Acme Inc.
Toggle sidebar
muhammadsami/laravel-crud-generator

Laravel CRUD Generator using Repository Pattern by Muhammad Sami

15
0
About muhammadsami/laravel-crud-generator

muhammadsami/laravel-crud-generator is a Laravel package for laravel crud generator using repository pattern by muhammad sami. It currently has 0 GitHub stars and 15 downloads on Packagist. Install it with composer require muhammadsami/laravel-crud-generator. Discover more Laravel packages by muhammadsami or browse all Laravel packages to compare alternatives.

Last updated

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
Comments