joshlogic/hotswap

A Laravel package that enables modular development by generating self-contained packages with routes, migrations, service providers, and frontend scaffolding.

dev-main 2025-09-14 17:46 UTC

This package is not auto-updated.

Last update: 2025-09-14 18:07:41 UTC


README

Hotswap Logo

Hotswap

Hotswap is a Laravel package that enables modular development by generating self-contained packages with their own routes, migrations, service providers, and frontend scaffolding. It’s designed to make building reusable Laravel + Inertia + Vite modules simple and fast.

πŸš€ Installation

Install the package via Packagist

composer require joshlogic/hotswap:dev-main

Publish the core scaffolding:

php artisan hotswap:scaffold

⚑ Usage

Create a new module (e.g., ecommerce):

php artisan hotswap:create ecommerce

Rebuild autoload files:

composer dump-autoload

Compile frontend assets:

npm run build

Run the development server:

php artisan serve  

πŸ” Models, Controllers and Migrations

Easily generate models, controllers, and migrations within a specific module (e.g., ecommerce) using the following commands:

Create a Model (with Migration & Controller)

php artisan hotswap:model ecommerce Product -mcr

Create a Controller

php artisan hotswap:controller ecommerce Product

Create a Model

php artisan hotswap:model ecommerce Product

Create a Migration

php artisan hotswap:migration ecommerce products

πŸ€– Other commands

Manage your modules with the following commands:

Pause a Module

Temporarily disable a module so it cannot be accessed by users (e.g., ecommerce):

php artisan hotswap:pause ecommerce

Resume a Module

Re-enable a previously paused module:

php artisan hotswap:play ecommerce

Remove a Module

Permanently delete a module:

php artisan hotswap:remove ecommerce

πŸ“· Export images

Export images from hotswap module to the root public folder:

php artisan vendor:publish --tag=public --force

πŸ“‚ What you get

Modular routes

Independent migrations & seeders

Built-in React (Inertia.js) page scaffolding

Automatic Vite config updates

Service provider registration

πŸ“ License

Hotswap is open-source software licensed under the MIT license.