Git Product home page Git Product logo

laravel-module-management's Introduction

Laravel Module Management

A simple package to set up module management in laravel

This package helps you to create/manage modules in laravel with ease.

Installation

composer require sarav/module

Setup

Register the service provider in config/app.php

Sarav\Providers\ModuleServiceProvider::class

Guide

Once you have installed the package, you can create a module by the following command

php artisan make:module <ModuleName>

For example, consider you have set the module name as User, then this will create the User module under app folder.

Following files are created for each module

Files Location TYPE
UserController (App\User\Http\Controllers) Controller
UserRequest (App\User\Http\Requests) FormRequest
User (App\User\Model) Model
UserRepository (App\User\Repository) Repository
UserInterface (App\User\Repository) Interface
routes.php (App\User\Http) routes file
RouteServiceProvider (App\User\Providers) RouteServiceProvider
UserServiceProvider (App\User\Providers) Individual Service Provider

Now you can register the created UserServiceProvider in your config/app.php to enable this module.

Thats it! Thats all you need to enable a module.

Creating Table

You can also create table while creating module by adding --migrate=true command

php artisan make:module User --migrate=true

Creating Under namespace

You can also create module under a specific namespace folder

php artisan make:module User --namespace=Testing

Above command will create our module under Testing folder outside app folder.

If you want it to create inside app folder, then you can specify it like

php artisan make:module Testing/User

this command will create User module under app/Testing folder

laravel-module-management's People

Contributors

sarav-s avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.