This package is not installable via Composer 1.x, please make sure you upgrade to Composer 2+. Read more about our Composer 1.x deprecation policy.

Modular Pattern & Module Management for Laravel 5

dev-master 2016-09-16 14:10 UTC

This package is auto-updated.

Last update: 2021-09-12 12:35:40 UTC


README

Modular Pattern & Module Management for Laravel 5

alt tag

Installation

The best way to install this package is through your terminal via Composer.

Add the following line to the composer.json file and fire composer update

"furkankadioglu/modvel": "dev-master"

Once this operation is complete, simply add the service provider to your project's config/app.php

Service Provider
furkankadioglu\Modvel\ModuleServiceProvider::class,

Config

Getting to module config file and generators:

php artisan vendor:publish

Commands

alt tag

  • php artisan module:make [module name]

alt tag

  • php artisan module:list

alt tag

  • php artisan module:migrate [module name]

alt tag

  • php artisan module:migrateall

alt tag

  • php artisan module:delete [module name]
Publish Files
laravel-project/
    config/
    |-- modulemanagement.php
    app/
    |-- BaseHelpers.php
    |-- Models/
        |-- Audio.php
        |-- Document.php
        |-- UploadedFile.php
        |-- Photo.php
        |-- Video.php
    |-- Http/
        |-- Controllers/
            |-- AdminTemplateController.php
            |-- MainTemplateController.php
            |-- AdminController.php
            |-- MainController.php
        |-- Middleware/
            |-- AdminMiddleware.php
    resources/
    |-- views/
        |-- masters/
            |-- admin.blade.php
            |-- main.blade.php

Example: Test Module Files
laravel-project/
    app/
    |-- modules/
        |-- Test
            |-- details.php
            |-- App/
                |-- Controllers/
                    |-- TestAdminSettingsController.php
                    |-- TestAdminController.php
                    |-- TestApiController.php
                    |-- TestController.php
                |-- Middlewares/
                |-- Models/
                    |-- Test.php
                    |-- TestModuleSetting.php
                |-- routes.php
                |-- TestHelpers.php
            |-- Config/
            |-- Resources/
                |-- views/
                    |-- admin/
                        |-- default/
                            |-- index.blade.php
                            |-- show.blade.php
                            |-- destroy.blade.php
                            |-- edit.blade.php
                            |-- create.blade.php
                            |-- settings/
                                |-- index.blade.php
                                |-- create.blade.php
                                |-- destroy.blade.php
                    |-- default/
                        |-- index.blade.php
                        |-- show.blade.php
                |-- lang/
                    |-- en/
                        |-- general.php
                    |-- tr/
                        |-- general.php
            |-- Database/
                |-- seeds/
                |-- migrations/
                    |-- 2016_01_01_010101_Test.php
                    |-- 2016_01_01_010101_TestSettings.php