teacoders/module-generator

This package is abandoned and no longer maintained. No replacement package was suggested.

This package will generate your module quite quickly and will save your time

3.0.1 2021-11-21 08:12 UTC

This package is auto-updated.

Last update: 2022-09-03 13:47:02 UTC


README

68747470733a2f2f746561636f646572732e696e2f696d616765732f6c6f676f2e706e67

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 support@teacoders.in instead of using the issue tracker.

Credits

License

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