Download the PHP package salodev/modularize without Composer

On this page you can find all versions of the php package salodev/modularize. 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 modularize

Modularize

This pakages give modular feature to your Laravel project.

So you now can improve better code organization, growing your productivity and reducing code analysis time.

You have a set of artisan commands to ease most common tasks such creating modules and its components.

File skeleton

From now you going to work with an structure as following:

Installation

After installation, the AppModule.php file will be placed into app\Modules folder, and it is the main modules registration point

Its content will see as following:

Code generator

In order to ease work, the package provides a set of commands to achieve most common tasks such as normal Laravel develompent. These commands will be under modularize: namespace

To see them, run the list artisan command:

the output will be similar to the following:

These commands will generate common files into specified module.

To know more about any command options, just ask for it help, as following:

Make a module

Just type:

Command is interactive. First, asks for parent module, from a list of previously generated modules. The first one is the app created by installation. Once parent is choosen, asks for a name and creates module file with the new class definition.

All modules depends of the root module or any submodule. The composition level is infinite.

Each module can define following components:

Some of these components must be registered or iniialized within module. Another will be registered automatically.

Register submodules with the provide() method at the register() method

When you create submodules by the artisan command, it checks the parent module, and will generate register() method if not created yet, or jus add the provide() call

Make module routes

Each module defines own routes. You can add new routes manually or using the artisan command

The artisan way

Make routes quickly with the following artisan command:

Program will ask for mofule, verb and name, and resource name At its ending your code will be properly updated.

To avoid use interactive mode, checkout the parameters list:

The manual way

Go to your desired module where want to add the route

add or edit the bootApiRoutes method for api routes, or the bootWebRoutes for web routes.

The following example shows how to add a new route for api:

Change module route prefix

By default generated routes prepends the module name. But you can define the routePrefix module property for another you want:

Migrations

Migrations module be stored in the Migrations folder within module folder

Following command creates module migration:

Because no parameter provided will ask you interactively.

So you can list created migration and check status:

Also you can check migrations for modules, to know where was created:

and the output will be similar to following:

Notice that you have the Directory column to see where each migration is placed

To run all migrations, just call as ever you did:

Configurations

Modules defines own configurations, and they are stored in the config.php file at the module root folder:

Files:

There is an content example for the app\Modules\Service\ServiceModule\config.php file:

To get its configurations, just call the ::config() method of desired module, as following:

Notice that also may be accessed by Laravel config() helper function:

Config file can be generated by the command:

All config keys will be rooted by app namepsace in order to avoid confilcts with package configurations.

All config keys will be nested by the parent module key.

The module key is the Module folder in kebab-case

Usage recommendations

In order to keep the project modularized as well, think each module as an package or a service itself. So try to keep all features inside the module or submodules.

Imagine an scaling scenario where should split your application in microservices or dependency packages. A well modularized project should not be a mess because just will need move files, but not modify them.

For file environment variables, try to include the module chain path including the configuration name in the variable name, as following:

file: app/Articles/config.php with expiration-time config variable name: APP_ARTICLES_EXPIRATION_TIME

Production environment considerations

In order to avoid increase deployment package size for production environments, this library was splitted in two parts:

So when you deploy to serverless such as AWS Lambda, make bundle with the --no-dev option in composer. So just salodev/modularize be bundled.

Licensing

This packages was provided with the Unlicense


All versions of modularize with dependencies

PHP Build Version
Package Version
Requires laravel/framework Version ^8|^9
marcusball/case-helper Version 0.1.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 salodev/modularize contains the following files

Loading the files please wait ....