Giter Club home page Giter Club logo

laravel-generator's Introduction

Laravel CRUD Generator

A Laravel package to generate CRUD operations quickly and easily using a YAML configuration file.

Installation

You can install the package via Composer:

composer require usermp/laravel-generator:dev-master

Configuration

Add the LaravelGeneratorServiceProvider class to the providers array in your config/app.php file:

'providers' => [
	// Other Service Providers
	Usermp\LaravelGenerator\LaravelGeneratorServiceProvider::class,
],

Usage

To generate a CRUD operation for a specific service, create a YAML configuration file and use the generate:crud Artisan command.

Example YAML Configuration

Below is an example YAML configuration file for generating a CRUD for an Post service:

service:
    name: Post
    fields:
        title: ["string", "required", "max:255"]
        slug: ["string", "required", "max:255"]
        description: ["text", "nullable"]
        author_id: ["integer", "User#id"]
    traits: [
      Illuminate\Notifications\Notifiable,
      Illuminate\Database\Eloquent\SoftDeletes
    ]

Generating CRUD

Once you have your YAML configuration file ready, run the following command to generate the CRUD operations:

php artisan generate:crud path/to/your-config-file.yaml

Replace path/to/your-config-file.yaml with the actual path to your YAML configuration file.

Features

  • Generates migration files based on the YAML configuration.
  • Creates Eloquent models with specified traits and fields.
  • Generates controllers with standard CRUD methods.
  • Creates form requests for validation rules.

License

This package is open-sourced software licensed under the MIT license.

Contact

For any inquiries or support, please reach out to [email protected].

laravel-generator's People

Contributors

usermp avatar

Stargazers

Mahdyar avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.