Download the PHP package laravel-modules/module-generator without Composer

On this page you can find all versions of the php package laravel-modules/module-generator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package module-generator

Module Generator

A simple and elegant tool that helps you scaffold application modules from stubs, and customize project files (composer.json, .env, routes, views, …) while doing so.

Requirements

The composer(), environment(), file() and crud() helpers work in any project. registerServiceProvider() additionally requires a full Laravel application at runtime.

Installation

Usage

Stubs Example

This example of users module:

You can specify publish path directory:

You can also replace published file names using the third and forth arguments $filesNameReplacement and $filesContentReplacement by adding array of [search => replacement]

Example of crud module generator:

Result:

Register Service Provider

You can register the service provider automatically by calling the registerServiceProvider() method. On Laravel 10 and below it is added to config/app.php; on Laravel 11+ it is added to bootstrap/providers.php. The call is idempotent — registering the same provider twice is a no-op.

Working with composer file

If you want to add a helper file to autoload, You can use mergeAutoloadFiles method:

You can add some packages to dont-discover by calling dontDiscover() method:

Working with .env.example file

Working with files

If the file doesn't exist, It will create a new one with the added content.

Modify files

Example file:

Working with CRUDs

This package allows you to generate full CRUD files, You can generate it by using the crud() method:

Here is an example of how to generate a user_categories CRUD:

Replacements of the CRUD words & file names:
Key Example
__CRUD_STUDLY_SINGULAR__ UserCategory
__CRUD_CAMEL_SINGULAR__ userCategory
__CRUD_TITLE_SINGULAR__ User Category
__CRUD_UCFIRST_SINGULAR__ User category
__CRUD_LOWER_SINGULAR__ user category
__CRUD_KEBAB_SINGULAR__ user-category
__CRUD_SNAKE_SINGULAR__ user_category
__CRUD_SNAKE_UPPER_SINGULAR__ USER_CATEGORY
__CRUD_PLAIN_SINGULAR__ usercategory
__CRUD_STUDLY_PLURAL__ UserCategories
__CRUD_CAMEL_PLURAL__ userCategories
__CRUD_TITLE_PLURAL__ User Categories
__CRUD_UCFIRST_PLURAL__ User categories
__CRUD_LOWER_PLURAL__ user categories
__CRUD_KEBAB_PLURAL__ user-categories
__CRUD_SNAKE_PLURAL__ user_categories
__CRUD_SNAKE_UPPER_PLURAL__ USER_CATEGORIES
__CRUD_PLAIN_PLURAL__ usercategories
Files Structure
sidebar.stub
Command to generate the CRUD files

Now you can run the command to generate a new CRUD:

Note: The file() and environment() helpers buffer all changes in memory and only touch the disk when you call publish(). Missing files (and their parent directories) are created at that point. This makes the API safe to chain and easy to reason about.

Testing

License

The MIT License (MIT). Please see the LICENSE file for more information.


All versions of module-generator with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
illuminate/support Version ^10.0|^11.0|^12.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package laravel-modules/module-generator contains the following files

Loading the files please wait ...