thereline/crudmaster

A Laravel package called CrudMaster that provides modular, flexible CRUD generation and response handling, tailored for both API and web (Inertia or Blade) apps.

dev-main 2025-07-08 19:58 UTC

This package is auto-updated.

Last update: 2025-08-26 16:18:22 UTC


README

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

CrudMaster by Elcomware is a premium Laravel package that helps you scaffold professional, scalable, and modern CRUD systems in minutes. It supports full-stack development โ€” from clean API endpoints to dynamic frontend-ready scaffolding for Inertia.js or Blade-based apps.

๐Ÿš€ Features

  • โš™๏ธ Instant CRUD generation (Model, Migration, Controller, Request, Policy, Routes)
  • ๐ŸŽจ Supports Blade or Inertia (Vue) UI stacks
  • ๐Ÿงฉ JSON API-ready controllers with clean unified response
  • ๐Ÿงฑ Custom stub system for flexible scaffolding
  • ๐Ÿ“‚ Auto-register routes, views, and assets
  • โœ… Unified response helpers (Success, Error, Validation)
  • ๐Ÿงช Built-in test support & publishable config/assets
  • ๐Ÿ“ฆ Laravel 10+ and 12+ ready

๐Ÿ“ฆ Installation

composer require elcomware/crudmaster

๐Ÿ”ง If using Laravel < 5.5, manually register the service provider:

// config/app.php
'providers' => [
    CrudMaster\CrudMasterServiceProvider::class,
],

๐Ÿ“‚ Publish Assets

php artisan vendor:publish --tag=crudmaster-config     # Configuration file
php artisan vendor:publish --tag=crudmaster-views      # Blade views
php artisan vendor:publish --tag=crudmaster-stubs      # Customizable stubs
php artisan vendor:publish --tag=crudmaster-js         # Inertia-compatible JS

โšก Quick Start

Generate CRUD for a resource (e.g. Post):

php artisan crudmaster:make Post

Options:

Option Description
--inertia Generate Inertia + Vue scaffolding
--api API-only controller
--ui=blade Choose blade, inertia, or none
--fields=name:string,email:string,age:integer Scaffold with fields
--force Overwrite existing files

๐Ÿ”„ Response System

CrudMaster includes an intelligent response engine:

respond_success($payload, 'Component', ['extra'], 'Done', 'route.name');
respond_error('Something failed', 'redirect.back', ['details']);
respond_info('FYI message...');
respond_validation_failure($errors);

๐Ÿง  Automatically detects:

  • API (returns JSON)
  • Inertia (returns Inertia::render)
  • Blade (returns view or redirect)

โš™๏ธ Config (config/crudmaster.php)

return [
    'ui' => 'inertia',
    'default_namespace' => 'App\\Http\\Controllers',
    'response_class' => App\\Http\\Responses\\SuccessResponse::class,
    'routes' => [
        'prefix' => 'admin',
        'middleware' => ['web', 'auth'],
    ],
];

๐Ÿงช Testing

CrudMaster is ready for automated testing via Pest or PHPUnit.

php artisan test

๐Ÿ“ Folder Structure Overview

src/
โ”œโ”€โ”€ Commands/
โ”œโ”€โ”€ Generators/
โ”œโ”€โ”€ Responses/
โ”œโ”€โ”€ Stubs/
โ”œโ”€โ”€ Helpers/
โ”œโ”€โ”€ CrudMasterServiceProvider.php

๐Ÿ“– License

CrudMaster is open-source software licensed under the MIT license.

๐Ÿ’ฌ Support & Contributions

Need help? Found a bug? Want to contribute?

Your CRUD. Your Stack. Your Control โ€” with CrudMaster by Elcomware.