thereline/crudmaster

A laravel package for easy CRUD generation. Generate models, repositories, services, controllers, and views effortlessly with customizable options for Blade or Vue.

Fund package maintenance!
thereline

v0.4.1-alpha 2024-11-26 14:25 UTC

This package is auto-updated.

Last update: 2024-12-26 14:36:02 UTC


README

A Laravel package for easy CRUD generation. Generate models, repositories, services, controllers, and views effortlessly with customizable options for Blade or Vue.

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

CrudMaster is a powerful and flexible Laravel package designed to simplify the process of generating CRUD (Create, Read, Update, Delete) operations for any model. With CrudMaster, developers can quickly scaffold complete CRUD functionality, including models, repositories, action services, controllers, and views, saving time and reducing repetitive tasks.

Key Features:

Artisan Command: Easily generate CRUD operations using a single Artisan command.

Customizable Views: Choose between Blade or Vue.js for your front-end views.

Repository Pattern: Implements the repository pattern for clean and maintainable code.

Action Services: Encapsulate business logic in service classes for better code organization.

Automatic Migrations: Automatically generate and run migrations for your models.

Support us

We invest a lot of resources into creating best in class open source packages. You can support us by buying one of our paid products.

We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on our contact page. We publish all received postcards on our virtual postcard wall.

Installation

  1. Require the package via composer: You can install the package via composer:
composer require thereline/crudmaster
  1. Required for Front end styling
   npm install vite
   npm install tailwindcss
  1. Require for CrudMaster Tables
  • install lodash for debounce.
   npm install lodash
  • install vue-virtual-scroller rendering the visible rows only:
   npm install vue-virtual-scroller
  • install vue3-dragula for drag-and-drop functionality.
   npm install vue3-dragula
  • We'll use papaparse for CSV parsing.
   npm install papaparse
  1. Requirement for CrudMaster Forms
   npm install 
   @headlessui/vue 
   @inertiajs/inertia 
   @inertiajs/inertia-vue3  
   yup 
  • Form validation and validation rules
   npm install 
   @vuelidate/core  
   @vuelidate/validators
  • Add dark mode support using Tailwind's dark mode feature.
    Update tailwind.config.js:
   module.exports = {
      darkMode: 'class', // Enable dark mode support
      //rest of the code
   }
    
  1. Requirements for CrudPanels
      npm install 
      vue 
      vue-router 
      vuex 
      @inertiajs/inertia 
      @inertiajs/inertia-vue3 
      tailwindcss 
      @headlessui/vue 
      i18next 
      i18next-browser-languagedetector 
      i18next-http-backend
  1. Publish the assets:
  • You can publish provider with:
   php artisan vendor:publish  --tag=crudmaster-providers
  • You should merge package's package.json with main package.json with:
   php artisan crudmaster:merge-package-json
  1. You can publish and run the migrations with:
   php artisan vendor:publish --tag="crudmaster-migrations"
   php artisan migrate

You can publish the config file with:

   php artisan vendor:publish --tag="crudmaster-config"

This is the contents of the published config file:

   return [
   ];

Optionally, you can publish the views using

   php artisan vendor:publish --tag="crudmaster-views"

Optionally, you can publish the translations using

   php artisan vendor:publish --tag=your-package-name-translations
  1. Install the npm dependencies:
  npm install
  1. Build the assets:
  npm run dev

Usage

   $crudMaster = new Thereline\CrudMaster();
   echo $crudMaster->echoPhrase('Hello, Thereline!');
  1. Generate CRUD:
   php artisan crudmaster:generate ModelName --columns=name,email,password --views=blade

Testing

   composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.