GithubHelp home page GithubHelp logo

module-generator's Introduction

Module Generator

Latest Version on Packagist Total Downloads

About Teacoders

We craft web applications & open source packages in the Laravel ecosystem.

Installation

You can install latest version (only supports in laravel 8):

composer require teacoders/module-generator:dev-main

if you want to install it in laravel 6 or 7

composer require teacoders/module-generator:^2.0

Run the command below to publish the package config file

php artisan vendor:publish --provider="TeaCoders\ModuleGenerator\ModuleServiceProvider"

Run the command below to generate all the required files for the module(model, controller, migration, request, view, route)

php artisan make:all <module name> (Product or ServiceCategory)
  • After that it will ask "Do you want to add columns in migration ? (yes/no) [no]":

  • If you enter yes/y then it will ask comma(,) seperated column names (ex: name,avatar)

  • If you hit enter then it will ask data types for these columns, press enter after selecting data types

  • After that it will ask that "Do you want to create request class?" if you enter yes/y then it will create request class and validations for your migration columns, if you enter no/n then it will add validations in controller.

Run the command below to generate view

php artisan make:view <view name>

Run the given command to generate specific view file inside the view directory

php artisan make:view <view directory name> --file=filename

Run the given command to delete whole module(model, controller, migration, request, view, route)

php artisan delete:all <module name> (Product)

Run the below command to delete specific file from module

php artisan delete:all <module name> -c|--controller, -m|--model, -r|--request, -t|--table, -b|--blade

Run the below command to delete view

php artisan delete:view <view name>

Run the below command to delete specific view file inside the view directory

php artisan delete:view <view name> --file=filename

Run the command below to generate trait

php artisan make:trait <trait1 trait2> // you can also create multiple traits

Run the command below to delete trait

php artisan delete:trait <trait1 trait2> // you can also delete multiple traits

If you want to generate more view files then change in config/module-generator.php

return [
    'files' => [
        'create',
        'edit',
        'index',
        'show', 
        // add more file names
    ]
];

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

License

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

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.