Git Product home page Git Product logo

laramodule's Introduction

Laravel HMVC

Latest Stable Version Total Downloads License

Laramodule is a package for the Laravel framework that allows developers to organize and manage modules within their web application. It is designed to make it easy to create, manage and reuse modular components within a Laravel application.

With Laramodule, developers can create new modules that can be easily added to their application, and can also manage existing modules. It also allows developers to keep their code organized and maintainable, by separating different functionality into different modules. Each module can include its own controllers, views, routes, and other components.

Laramodule also provides an easy to use API for interacting with modules and their components. This allows developers to perform tasks such as enabling or disabling modules, and accessing module specific data or functionality.

Laramodule is a powerful tool for developers who want to create modular and maintainable applications with Laravel. It can help developers to speed up development, improve code quality and maintain a cleaner structure of their application.

To install through Composer, by run the following command:

$ composer require hexters/laramodule

Autoloading

By default the module classes are not loaded automatically. You can autoload your modules using psr-4. For example :

{
  "autoload": {
    "psr-4": {
      "App\\": "app/",
      "Modules\\": "Modules/",
      "Database\\Factories\\": "database/factories/",
      "Database\\Seeders\\": "database/seeders/"
    }
  }
}

And make Modules directory in your root project folder

mkdir Modules
  • don't forget to run composer dump-autoload afterwards

Managing assets

Install node module pacakge

npm install -D @hexters/ladmin-vite-input

Open vite.config.js in your project and follow the instruction below.

. . . 
import ladminViteInputs from '@hexters/ladmin-vite-input'
. . .

export default defineConfig({
    plugins: [
        laravel({
            input: ladminViteInputs([
                'resources/css/app.css',
                'resources/js/app.js'
            ]),
            refresh: true,
        }),
    ],
});

Install node dependencies in the modules folder

cd Modules/Blog && npm install

Back to the root project and run vite

npm run dev

Artisan

php artisan module:make Blog --command=OPTIONAL
php artisan module:make-cast BlogCast --module=Blog
php artisan module:make-channel BlogChannel --module=Blog
php artisan module:make-command BlogCommand --module=Blog
php artisan module:make-component BlogComponent --module=Blog
php artisan module:make-controller BlogController --module=Blog
php artisan module:make-event BlogEvent --module=Blog
php artisan module:make-exception BlogException --module=Blog
php artisan module:make-factory BlogFactory --module=Blog
php artisan module:make-job BlogJob --module=Blog
php artisan module:make-listener BlogListener --module=Blog
php artisan module:make-mail BlogMail --module=Blog
php artisan module:make-middleware BlogMiddleware --module=Blog
php artisan module:make-migration BlogMigration --module=Blog
php artisan module:make-model BlogModel --module=Blog
php artisan module:make-notification BlogNotification --module=Blog
php artisan module:make-observer BlogObserver --module=Blog
php artisan module:make-policy BlogPolicy --module=Blog
php artisan module:make-provider BlogProvider --module=Blog
php artisan module:make-request BlogRequest --module=Blog
php artisan module:make-resource BlogResource --module=Blog
php artisan module:make-rule BlogRule --module=Blog
php artisan module:make-scope BlogScope --module=Blog
php artisan module:make-seeder BlogSeeder --module=Blog
php artisan module:make-test BlogTest --module=Blog
php artisan module:publish Blog

Happy coding ☕

Inertia Support

For inertia support will be coming soon, stay tuned for updates.

Donate

If this Laravel package was useful to you, please consider donating some coffee ☕☕☕☕

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.