React Starter Kit - v1.0.1
Modular Structure
The starter kit can install nwidart/laravel-modules for a feature-module layout. This is opt-in via the optional packages prompt.
Enabling
Triggered automatically during composer create-project when you answer yes to:
Would you like to use a modular Laravel structure?
You can also re-run it later:
php artisan artisanpack:optional-packages-command
What gets installed
composer require nwidart/laravel-modulesphp artisan vendor:publish --provider="Nwidart\Modules\LaravelModulesServiceProvider"- Updates
composer.jsonto add merge-plugin config:"extra": { "merge-plugin": { "include": ["Modules/*/composer.json"] } } - Scaffolds three default modules:
Admin,Auth,Users composer dump-autoload
Adding a new module
php artisan module:make Reports
Creates Modules/Reports/ with controllers, models, migrations, and a service provider already wired.
Module structure
Modules/Reports/
├── Config/
├── Console/
├── Database/
│ ├── Migrations/
│ ├── Seeders/
│ └── Factories/
├── Http/
│ ├── Controllers/
│ ├── Middleware/
│ └── Requests/
├── Models/
├── Providers/
│ └── ReportsServiceProvider.php
├── Resources/
│ └── views/
├── Routes/
│ ├── web.php
│ ├── api.php
│ └── console.php
├── Tests/
├── composer.json
└── module.json
Inertia pages inside a module
Modules can ship their own Inertia pages, but they live alongside the application's pages — Inertia's page resolver scans resources/js/pages/**. Either:
- Put the pages under
resources/js/pages/Reports/*.tsxand have the module's controllers render'Reports/Index', etc., or - Add a glob to the page resolver in
resources/js/app.tsxto also scanModules/*/Resources/js/pages/**.
Option 1 is simpler and recommended.
Why no Livewire-modules adapter?
The original Livewire starter kit installed mhmiton/laravel-modules-livewire to wire module-namespaced Livewire components. Since this kit uses Inertia + React, that adapter doesn't apply — Inertia controllers live in modules just like regular Laravel controllers.
Docs
For everything else (CLI commands, configuration, testing modules, autoloading), see the official nwidart/laravel-modules docs.