Download the PHP package mnabialek/laravel-modular without Composer

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

Laravel Modular

Build Status Coverage Status Scrutinizer Code Quality StyleCI

This module makes managing your Laravel 5 application much more easier. No more putting dozens or hundreds of files into single directory.

Now you can create for your Laravel 5 application multiple modules and each of them will have its own structure (in the way you decide).

Supported version

To install in Laravel 5.3+ use this branch, however to install in Laravel < 5.3 please refer to version 0.1.

Installation

  1. For Laravel 5.3+ run

    in console to install this module.

  2. Open config/app.php and:

    • Add

      in same section (providers)

    • Add

      into aliases section

  3. Run

    in your console to publish default configuration files, sample app files (published in app/Core) and sample stubs files

  4. In default seeder database/seeds/DatabaseSeeder at the end of run method add:

  5. In app/Providers/RouteServiceProvider.php at the end of map function add

  6. In database/factories/ModelFactory.php (this step applies only to Laravel 5.1+) add at the end of file:

Getting started

To get started run:

This command will create your TestModule module structure. Open directory and look at its structure. As you see some files uses app/Core abstract classes (those file where created during installation).

First decide, whether you want to use app/Core files or not. If not, you can remove this directory. Go to resources/stubs/modular and look at sample stubs. You can now alter them depending on your needs (you can remove all usages of app/Core files`, create new stubs etc.

Now open config/modular.php file, go to stubs_groups section and adjust default structure - you can specify here what directories and files should be created for default modules. When you finish, run:

Now this new module will be created according to your needs. Great - you created your first module as you wanted!

Customization

This module is highly customizable. The concept is based on using group stubs and in each group you can define which directories should be created and which files should be created (you can omit directories if you want when in those directories you want to place files - they will be automatically created).

You can create multiple stubs groups, you can configure many things. Just go to config/modular.php and look at sample settings and comments in this file - if you want to change them, just do it, generate new sample module (or files) and see what will happen.

For all stubs groups the following replacements will be done for filename and file content (assuming you haven't changed default { and } separators to custom ones):

Routing customization

By default for each module you can load 2 routing files - web.php and api.php if you followed installation instructions. However, you might also decide to use single routing file for each module. In this case use

only in step 5 of installation.

You can also decide to put the whole routing files in groups as defaults in Laravel 5.3. In this case you can do it also in RouteServiceProvider - in such case please remember to alter your routes stubs to not apply same middleware twice because it will cause unexpected issues in your Laravel application.

Available commands

module:make

This command creates new modules. You can create one module or multiple modules at once.

Example usage:

You can control what is created when running this command in config/modular.php in stubs_groups section. You can pass optional stub group name using --group=test in case you want to use multiple types of modules.

module:files

Allow to create files in module that already exists.

Example usage:

You can control what is created when running this command in config/simplemodules.php in stubs_groups section. You can pass optional stub group name using --group=test.

By default it creates "submodule" in existing module.

module:create-migration

Creates migration file in given module

Example usage:

You can also use optional --type and --table options to set table and type of migration (you can of course create own types if you want) in order to create migration with template for given type, for example:

it will create migration that is of type create - so in up method there will be creating cameras table and in down method deleting cameras table

module:seed

Runs main seeder for given modules. You need to remember that only main seeder will be launched. In case you have multiple seeders in single module, you should manually run extra seeders in main module seeder.

Example usage:

migrate

This module register modules paths so when you run default Laravel migrate command all migrations will be run (both general and for all active modules)

Example usage:

db:seed

If you done all steps in Installation section when you run db:seed command all main seeds from active modules will be run

Example usage:

Optimization

By default (you can customize it in config file), all modules are created with 2 options - active and routes - by default they are both set to true. The general rule for all modules options is like this - if option is set for module in configuration file, it will be used, otherwise some extra checks will be made to calculate. It does not apply to active option - in case it's missing it's assumed to be true.

Available options for modules:

In addition to use custom routing files, you can use also additional settings:

Prefix of option should match the name of routing file, if you would like additional extra.php routing file, you could use extra_routes option.

Be aware in case option set in configuration file won't be valid, some unexpected situations might happen. For example, if you set provider to false but later you will add service provider to module, it won't he loaded unless you change provider option to true or you remove it completely from configuration file for this module.

Release notes

Please refer to Changelog

Licence

This package is licenced under the MIT license


All versions of laravel-modular with dependencies

PHP Build Version
Package Version
Requires laravel/framework Version ^5.3
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 mnabialek/laravel-modular contains the following files

Loading the files please wait ....