### Install npm dependencies Source: https://laravelmodules.com/docs/13/basic-usage/compiling-assets The default package.json file includes everything needed to get started. Install the dependencies it references. ```bash npm install ``` -------------------------------- ### Inertia Component Generation Examples Source: https://laravelmodules.com/docs/13/resources/inertia Examples of generating components for different frameworks and directory structures. ```bash php artisan module:make-inertia-component Button Blog # → resources/js/Components/Button.vue php artisan module:make-inertia-component UI/Modal Blog --react # → resources/js/Components/UI/Modal.jsx php artisan module:make-inertia-component DataTable Blog --svelte # → resources/js/Components/DataTable.svelte ``` -------------------------------- ### Install Inertia Laravel server-side adapter Source: https://laravelmodules.com/docs/13/resources/inertia Run this Composer command to install the Inertia server-side adapter for Laravel. Required before proceeding with Inertia setup. ```bash composer require inertiajs/inertia-laravel ``` -------------------------------- ### Example module_statuses.json Source: https://laravelmodules.com/docs/13/basic-usage/configuration Shows the JSON structure for module statuses. The example has a single module 'Users' enabled. ```json { "Users": true } ``` -------------------------------- ### Install a module from a Composer package name Source: https://laravelmodules.com/docs/13/advanced/facade-methods Use Module::install() with the Composer package name to install a module. The example shows installing 'nwidart/article-module'. ```php Module::install('nwidart/article-module'); ``` -------------------------------- ### Initialize Git repository Source: https://laravelmodules.com/docs/13/advanced/publishing-modules Run 'git init' in the module directory to start version control. ```bash git init ``` -------------------------------- ### Enable a module with artisan Source: https://laravelmodules.com/docs/13/advanced/publishing-modules Run this artisan command to activate the module after installation. ```bash php artisan module:enable moduleName ``` -------------------------------- ### Install Spatie Laravel Permission via Composer Source: https://laravelmodules.com/docs/13/resources/spatie-laravel-permission Install the spatie/laravel-permission package using Composer. Run this command in the terminal at the project root. ```bash composer require spatie/laravel-permission ``` -------------------------------- ### Install laravel-mix-merge-manifest Source: https://laravelmodules.com/docs/13/basic-usage/compiling-assets Install the package to prevent the main Laravel Mix configuration from overwriting the public/mix-manifest.json file. ```bash npm install laravel-mix-merge-manifest --save-dev ``` -------------------------------- ### Install laravel-modules with Composer Source: https://laravelmodules.com/docs/13/getting-started/introduction Installs the nwidart/laravel-modules package via Composer. ```bash composer require nwidart/laravel-modules ``` -------------------------------- ### Install module via Composer Source: https://laravelmodules.com/docs/13/advanced/publishing-modules Use the composer require command to install a published module, e.g., nwidart/article-module. ```bash composer require nwidart/article-module ``` -------------------------------- ### Module::install Source: https://laravelmodules.com/docs/13/advanced/facade-methods Installs a module from a Composer package name. ```APIDOC ## Module::install ### Description Installs a module from a Composer package name. ### Method Module::install ### Parameters - **packageName** (string) - Required - The Composer package name of the module to install. ### Example ```php Module::install('nwidart/article-module'); ``` ``` -------------------------------- ### Example web route in Modules/Blog/routes/web.php Source: https://laravelmodules.com/docs/13/basic-usage/routing Default route file for a module. Uses the 'web' middleware, a 'blog' prefix, and a 'blog.' name prefix so the route is accessible at /blog and named 'blog.index'. ```php prefix('blog') ->name('blog.') ->group(function () { Route::get('/', [BlogController::class, 'index'])->name('index'); }); ``` -------------------------------- ### Create a controller in a subdirectory with module:make-controller Source: https://laravelmodules.com/docs/13/basic-usage/controllers Use the module:make-controller command with a subdirectory prefix to place a controller under a sub-namespace. The example creates Api/PostController in the Blog module. ```bash php artisan module:make-controller Api/PostController Blog ``` -------------------------------- ### boot method: register routes, views, translations, and observers Source: https://laravelmodules.com/docs/13/basic-usage/service-providers Use the boot method to register routes, views, translations, and anything that needs to run after all service providers have been registered. The example shows registering translations, config, views, migrations, an observer, and a view composer. ```php public function boot(): void { $this->registerTranslations(); $this->registerConfig(); $this->registerViews(); $this->loadMigrationsFrom(module_path($this->moduleName, 'database/migrations')); // Register observers Post::observe(PostObserver::class); // Share data with all views in this module view()->composer('blog::*', function ($view) { $view->with('currentUser', auth()->user()); }); } ``` -------------------------------- ### Inertia Page Generation Examples Source: https://laravelmodules.com/docs/13/resources/inertia Shows the command with different options: default config, explicit framework override, subdirectory support, and automatic Studly-casing of the page name. ```bash # Uses config default php artisan module:make-inertia-page Index Blog ``` ```bash # Explicit framework override php artisan module:make-inertia-page Index Blog --react ``` ```bash # Subdirectory php artisan module:make-inertia-page Contacts/Index Blog # → resources/js/Pages/Contacts/Index.vue ``` ```bash # Studly-cases the name automatically php artisan module:make-inertia-page my-dashboard Blog # → resources/js/Pages/Contacts/Index.vue ``` -------------------------------- ### Install symfony/filesystem via Composer Source: https://laravelmodules.com/docs/13/resources/custom-module-generator Installs the Symfony Filesystem package, which is required for the Filesystem class used in the command. ```bash composer require symfony/filesystem ``` -------------------------------- ### register method: bind services and register providers Source: https://laravelmodules.com/docs/13/basic-usage/service-providers Use the register method to bind services into the container or register additional service providers. This runs before the application is fully booted. The example shows registering a route service provider, binding an interface to an implementation, and registering a singleton. ```php public function register(): void { $this->app->register(RouteServiceProvider::class); // Bind an interface to an implementation $this->app->bind( \Modules\Blog\Contracts\PostRepositoryInterface::class, \Modules\Blog\Repositories\EloquentPostRepository::class ); // Register a singleton $this->app->singleton(PostService::class, function ($app) { return new PostService($app->make(PostRepositoryInterface::class)); }); } ``` -------------------------------- ### Get module paths with getPath(), getAppPath(), getExtraPath() Source: https://laravelmodules.com/docs/13/advanced/module-methods Retrieve filesystem paths for the module directory, its app/ subdirectory, and custom subdirectories via getExtraPath(). ```php $module->getPath(); // full path to the module directory $module->getAppPath(); // path to the module's app/ subdirectory $module->getExtraPath('routes'); // path to module/routes $module->getExtraPath('resources/views'); // path to module/resources/views ``` -------------------------------- ### Custom modules setup in config/modules-livewire.php Source: https://laravelmodules.com/docs/13/resources/livewire Configuration block for registering custom modules in the Livewire module setup. Remove the comment markers and add your custom modules to enable them. ```php /* |-------------------------------------------------------------------------- | Custom modules setup |-------------------------------------------------------------------------- | */ // 'custom_modules' => [ // 'Chat' => [ // 'path' => base_path('libraries/Chat'), // 'module_namespace' => 'Libraries\\Chat', // // 'namespace' => 'Http\\Livewire', // // 'view' => 'Resources/views/livewire', // // 'name_lower' => 'chat', // ], // ], ``` -------------------------------- ### Pluralisation example Source: https://laravelmodules.com/docs/13/advanced/languages Shows pluralisation syntax in a Laravel language file. ```php // lang/en/messages.php 'posts' => '{0} No posts|{1} One post|[2,*] :count posts', ``` -------------------------------- ### Get All Module Paths for IDE Indexing with Module::all() Source: https://laravelmodules.com/docs/13/advanced/module-methods Collects the paths of all modules into an array, useful for IDE indexing or other path-based operations. ```php $paths = collect(Module::all())->map(fn ($m) => $m->getPath())->values()->all(); ``` -------------------------------- ### Get module description and priority Source: https://laravelmodules.com/docs/13/advanced/module-methods Retrieve the 'description' and 'priority' values from the module's module.json file. The priority is returned as an integer. ```php $module->getDescription(); // value of "description" in module.json $module->getPriority(); // value of "priority" in module.json (int) ``` -------------------------------- ### Generate a model with module:make-model Source: https://laravelmodules.com/docs/13/advanced/artisan-commands Creates a new model for the specified module. The example shows the command with the model name and module name, followed by the available options for generating associated files like controllers, factories, migrations, requests, and seeders. ```bash php artisan module:make-model Post Blog ``` ```bash -c, --controller Flag to create associated controllers --fillable[=FILLABLE] The fillable attributes. -f, --factory Create a new factory for the model -m, --migration Flag to create associated migrations -r, --request Create a new request for the model -s, --seed Create a new seeder for the model ``` ```bash -a, --all Flag to create all associated files -R, --resource Create a new resource for the model -p, --policy Create a new policy for the model ``` -------------------------------- ### Get modules as collection: toCollection() and collections() Source: https://laravelmodules.com/docs/13/advanced/facade-methods Returns modules as a collection. Module::toCollection() returns all modules; Module::collections() returns only enabled modules. ```php $collection = Module::toCollection(); $collection = Module::collections(); // enabled modules only ``` -------------------------------- ### Module directory structure example Source: https://laravelmodules.com/docs/13 Shows the intended directory layout for a modular Laravel application using this package. Each module (Blog, Shop, Users) contains all feature-related code. The same tree is displayed twice in the source, once under the heading and once in a copyable block. ```text Modules/ ├── Blog/ ← all blog-related code lives here ├── Shop/ ← all shop-related code lives here └── Users/ ← all user-management code lives here ``` ```text Modules/ ├── Blog/ ← all blog-related code lives here ├── Shop/ ← all shop-related code lives here └── Users/ ← all user-management code lives here ``` -------------------------------- ### Complete module migration example Source: https://laravelmodules.com/docs/13/database/migrations A complete migration class that creates a posts table with an id, a foreign key to users with cascade on delete, and a timestamp. Uses the standard Laravel migration structure with an anonymous class. ```php id(); $table->foreignId('user_id')->constrained()->cascadeOnDelete(); $table->foreignId('user_id')->constrained()->cascadeOnDelete(); }); } }; ``` -------------------------------- ### Laravel module controller with placeholders Source: https://laravelmodules.com/docs/13/resources/custom-module-generator Example controller using the placeholders. Shows how {Module}, {module}, and {Model} are used in a controller class, including the namespace, imports, and view path. ```php namespace Modules\{Module}\Http\Controllers; use Illuminate\Http\Request; use Illuminate\Routing\Controller; use Modules\{Module}\Models\{Model}; class {Module}Controller extends Controller { public function index() { ${module} = {Model}::get(); return view('{module}::index', compact('{module}')); } } ``` ```php namespace Modules\{Module}\Http\Controllers; use Illuminate\Http\Request; use Illuminate\Routing\Controller; use Modules\{Module}\Models\{Model}; class {Module}Controller extends Controller { public function index() { ${module} = {Model}::get(); return view('{module}::index', compact('{module}')); } } ``` -------------------------------- ### module.json example Source: https://laravelmodules.com/docs/13/basic-usage/creating-a-module Defines the module's identity and bootstrap configuration. The name is the display name, alias is the lowercase identifier used for view namespacing, config keys, and translation lookups, priority controls boot/seed order, providers lists service providers to register, and files lists additional PHP files to include on boot. ```json { "name": "Blog", "alias": "blog", "description": "", "keywords": [], "priority": 0, "providers": [ "Modules\\Blog\\Providers\\BlogServiceProvider" ], "files": [] } ``` -------------------------------- ### Stage and commit initial files Source: https://laravelmodules.com/docs/13/advanced/publishing-modules Add all files and create the first commit. ```bash git add . git commit -m 'first commit' ``` -------------------------------- ### Enable and migrate a module Source: https://laravelmodules.com/docs/13/getting-started/introduction Enables the Blog module and runs its migrations. After these commands, the default web route and controller are ready at /blog. ```bash php artisan module:enable Blog php artisan module:migrate Blog ``` -------------------------------- ### Modules directory structure Source: https://laravelmodules.com/docs/13/getting-started/introduction Shows the top-level Modules directory layout with three example modules (Blog, Shop, Users). Each module groups all code related to one feature in a single folder. ```text Modules/ ├── Blog/ ← all blog-related code lives here ├── Shop/ ← all shop-related code lives here └── Users/ ← all user-management code lives here ``` -------------------------------- ### Rendering a Livewire component with module prefix Source: https://laravelmodules.com/docs/13/resources/livewire Renders a Livewire component using the module name as a prefix and the component class in kebab-case. The placeholder {module-lower-name} is replaced with the module's lowercase name. This example appears twice in the source, likely for emphasis or as part of a template. ```blade ``` -------------------------------- ### Read any key from module.json with get() Source: https://laravelmodules.com/docs/13/advanced/module-methods Use $module->get() to read any key from module.json. Provide a default value as the second argument to return when the key is missing. ```php $module->get('alias'); // "blog" $module->get('keywords'); // [] $module->get('missing', 'default'); // returns 'default' if key not found ``` -------------------------------- ### module:list: List all modules Source: https://laravelmodules.com/docs/13/advanced/artisan-commands Lists all available modules. ```bash php artisan module:list ``` -------------------------------- ### Create a plain module with --plain Source: https://laravelmodules.com/docs/13/basic-usage/creating-a-module Creates a minimal module with no scaffolded files (no controller, no seeder, no service provider boilerplate). Useful when building the module structure from scratch. ```bash php artisan module:make Blog --plain ``` -------------------------------- ### Get all disabled modules: Module::allDisabled() Source: https://laravelmodules.com/docs/13/advanced/facade-methods Returns an array of only the disabled modules. ```php $inactiveModules = Module::allDisabled(); ``` -------------------------------- ### Publish Inertia entry point Source: https://laravelmodules.com/docs/13/resources/inertia Runs the module:publish-inertia Artisan command to publish a ready-made resources/js/app.js that resolves pages from the application and every module. Add --force to overwrite an existing file. ```bash php artisan module:publish-inertia ``` -------------------------------- ### Generate a resource controller with module:make-controller Source: https://laravelmodules.com/docs/13/basic-usage/controllers Generates a controller with index, create, store, show, edit, update, and destroy methods. Register it in routes/web.php using Route::resource. ```bash php artisan module:make-controller PostController Blog php artisan module:make-controller PostController Blog ``` ```php Route::resource('posts', PostController::class); Route::resource('posts', PostController::class); ``` -------------------------------- ### Get all enabled modules: Module::allEnabled() Source: https://laravelmodules.com/docs/13/advanced/facade-methods Returns an array of only the enabled modules. ```php $activeModules = Module::allEnabled(); ``` -------------------------------- ### Get all modules: Module::all() Source: https://laravelmodules.com/docs/13/advanced/facade-methods Returns an array of all modules, including both enabled and disabled ones. ```php $modules = Module::all(); ``` -------------------------------- ### Switch project to React in config/modules.php Source: https://laravelmodules.com/docs/13/resources/inertia Changes the default frontend framework for all Inertia-related commands to React. Place this in config/modules.php to switch the whole project. ```php // config/modules.php — switch your whole project to React: 'inertia' => [ 'frontend' => 'react', ], ``` -------------------------------- ### Filter modules by status: Module::getByStatus() Source: https://laravelmodules.com/docs/13/advanced/facade-methods Get modules by status: 1 for enabled, 0 for disabled. ```php $enabled = Module::getByStatus(1); $disabled = Module::getByStatus(0); ``` -------------------------------- ### module:enable: Enable module Source: https://laravelmodules.com/docs/13/advanced/artisan-commands Enables the given module. ```bash php artisan module:enable Blog ``` -------------------------------- ### Loop over permission groups in Blade Source: https://laravelmodules.com/docs/13/resources/spatie-laravel-permission Starts a foreach loop over the permission groups, where each group is keyed by module name. ```blade @foreach($permissionGroups as $module => $permissions) @foreach($permissionGroups as $module => $permissions) ``` -------------------------------- ### Lifecycle Methods Source: https://laravelmodules.com/docs/13/advanced/module-methods Methods to register and boot a module, and to fire custom module events. ```APIDOC ## Lifecycle Methods ### Description Methods to manage the module's lifecycle: registration, booting, and custom events. ### Methods - **register()** - Registers the module's service providers and aliases. - **boot()** - Boots the module (fires the 'boot' event). - **fireEvent(string $event)** - Fires a custom module event. ### Usage Examples ```php $module->register(); // register the module's service providers and aliases $module->boot(); // boot the module (fire 'boot' event) $module->fireEvent('custom-event'); ``` ``` -------------------------------- ### Get role and group permissions by module Source: https://laravelmodules.com/docs/13/resources/spatie-laravel-permission Retrieves a role by ID and groups all permissions by their 'module' attribute, ordered by module. ```php $role = Role::findOrFail($id); $permissionGroups = Permission::orderBy('module')->get()->groupBy('module'); $role = Role::findOrFail($id); $permissionGroups = Permission::orderBy('module')->get()->groupBy('module'); ``` -------------------------------- ### Generate migration: module:make-migration Source: https://laravelmodules.com/docs/13/advanced/artisan-commands Generates a migration for the specified module. Example: `php artisan module:make-migration create_posts_table Blog`. ```bash php artisan module:make-migration create_posts_table Blog ``` -------------------------------- ### Generate a plain controller with module:make-controller --plain Source: https://laravelmodules.com/docs/13/basic-usage/controllers Creates a controller with no boilerplate methods. Use the --plain flag with the module:make-controller command, specifying the controller name and module name. ```bash php artisan module:make-controller PostController Blog --plain php artisan module:make-controller PostController Blog --plain ``` -------------------------------- ### Customize MakeModuleCommand signature and description Source: https://laravelmodules.com/docs/13/resources/custom-module-generator Replace the default signature and description with 'make:module' and 'Create starter CRUD module' to call the command via make:module. ```php protected $signature = 'make:module'; protected $description = 'Create starter CRUD module'; ``` -------------------------------- ### Generate component: module:make-component Source: https://laravelmodules.com/docs/13/advanced/artisan-commands Generates the given component for the specified module. Example: `php artisan module:make-component Alert Blog`. ```bash php artisan module:make-component Alert Blog ``` -------------------------------- ### Passing Data to Views with compact() Source: https://laravelmodules.com/docs/13/basic-usage/views Use compact() to pass variables to a view. The example passes paginated posts and all categories to the 'blog::posts.index' view. ```php $posts = Post::latest()->paginate(20); $categories = Category::all(); return view('blog::posts.index', compact('posts', 'categories')); $posts = Post::latest()->paginate(20); $categories = Category::all(); return view('blog::posts.index', compact('posts', 'categories')); ``` -------------------------------- ### Registering a module event listener in EventServiceProvider Source: https://laravelmodules.com/docs/13/advanced/registering-module-events Shows how to register a listener for the ModuleEvent::BOOT event in the EventServiceProvider. ```php use Nwidart\Modules\Constants\ModuleEvent; class EventServiceProvider extends ServiceProvider { protected $listen = [ ModuleEvent::BOOT => [ ModuleBootListener::class, ], ]; } ``` -------------------------------- ### Use factory states in tests Source: https://laravelmodules.com/docs/13/database/seeders-and-factories Shows how to create posts with different states using the factory: published (default), draft, and scheduled (with count). ```php // Create a published post $post = Post::factory()->create(); // Create a draft $post = Post::factory()->draft()->create(); // Create 10 scheduled posts $posts = Post::factory()->scheduled()->count(10)->create(); ``` -------------------------------- ### module_path('Blog') returns absolute path Source: https://laravelmodules.com/docs/13/basic-usage/helpers Returns the absolute path to the module's directory. The example shows the output for a module named 'Blog'. ```php $path = module_path('Blog'); // /var/www/your-app/Modules/Blog ``` -------------------------------- ### Run fresh module migrations for Blog Source: https://laravelmodules.com/docs/13/database/migrations Drops all tables and re-runs all module migrations from scratch for the Blog module. This also affects tables created by other modules or the main application if they share the same database. ```bash php artisan module:migrate-fresh Blog ``` -------------------------------- ### Generated form request class Source: https://laravelmodules.com/docs/13/basic-usage/controllers Example of the generated form request class placed in Modules/Blog/app/Http/Requests/. It extends FormRequest and defines authorize() and rules() methods. ```php ['required', 'string', 'max:255'], 'slug' => ['required', 'string', 'unique:posts,slug'], 'body' => ['required', 'string'], 'published_at' => ['nullable', 'date'], ]; } } ``` -------------------------------- ### Generate trait class: module:make-trait Source: https://laravelmodules.com/docs/13/advanced/artisan-commands Generates a trait class for a specific module. Example: `php artisan module:make-trait Sluggable Blog`. ```bash php artisan module:make-trait Sluggable Blog ``` -------------------------------- ### Generate seed: module:make-seed Source: https://laravelmodules.com/docs/13/advanced/artisan-commands Generates the given seed name for the specified module. Example: `php artisan module:make-seed seed_fake_blog_posts Blog`. ```bash php artisan module:make-seed seed_fake_blog_posts Blog ``` -------------------------------- ### Generate model with migration, factory, and seeder Source: https://laravelmodules.com/docs/13/database/models Generates a model along with a migration, factory, and seeder in one command using the `--migration`, `--factory`, and `--seed` flags. ```bash php artisan module:make-model Post Blog --migration --factory --seed ``` -------------------------------- ### Generate service class: module:make-service Source: https://laravelmodules.com/docs/13/advanced/artisan-commands Generates a service class for a specific module. Example: `php artisan module:make-service PostService Blog`. ```bash php artisan module:make-service PostService Blog ``` -------------------------------- ### Simulate module migrations Source: https://laravelmodules.com/docs/13/database/migrations Simulates the migration without actually executing it, useful for previewing the SQL that would be run. ```bash php artisan module:migrate Blog --pretend ``` -------------------------------- ### boot method for loading migrations Source: https://laravelmodules.com/docs/13/advanced/module-resources Loads module migrations from the module's `database/migrations` directory. This allows `php artisan migrate` to automatically pick up module migrations without extra configuration. ```php public function boot(): void { $this->loadMigrationsFrom(module_path($this->moduleName, 'database/migrations')); } ``` -------------------------------- ### Generate repository class: module:make-repository Source: https://laravelmodules.com/docs/13/advanced/artisan-commands Generates a repository class for a specific module. Example: `php artisan module:make-repository PostRepository Blog`. ```bash php artisan module:make-repository PostRepository Blog ``` -------------------------------- ### Enable and Disable Modules with Module::enable and Module::disable Source: https://laravelmodules.com/docs/13/advanced/facade-methods Use these methods to enable or disable a module by its name. ```php Module::enable('Blog'); Module::disable('Blog'); Module::enable('Blog'); Module::disable('Blog'); ``` -------------------------------- ### Generate observer class: module:make-observer Source: https://laravelmodules.com/docs/13/advanced/artisan-commands Generates an observer class for a specific module. Example: `php artisan module:make-observer PostObserver Blog`. ```bash php artisan module:make-observer PostObserver Blog ``` -------------------------------- ### Generate interface class: module:make-interface Source: https://laravelmodules.com/docs/13/advanced/artisan-commands Generates an interface class for a specific module. Example: `php artisan module:make-interface PostRepositoryInterface Blog`. ```bash php artisan module:make-interface PostRepositoryInterface Blog ``` -------------------------------- ### Placeholder: {module_} - lowercase module name with underscores Source: https://laravelmodules.com/docs/13/resources/custom-module-generator Placeholder for the module name in all lowercase with spaces replaced by underscores. ```text {module_} {module_} ``` -------------------------------- ### Generate helper class: module:make-helper Source: https://laravelmodules.com/docs/13/advanced/artisan-commands Generates a helper class for a specific module. Example: `php artisan module:make-helper StringHelper Blog`. ```bash php artisan module:make-helper StringHelper Blog ``` -------------------------------- ### Create an EventServiceProvider class Source: https://laravelmodules.com/docs/13/advanced/registering-module-events Create a new class called EventServiceProvider in the Modules/Blog/Providers folder. This class extends the base EventServiceProvider and is used to register all events and their listeners in a dedicated service provider. ```php get($key, $default = null) ### Parameters #### Path Parameters - **key** (string) - Required - The key to retrieve from module.json. - **default** (mixed) - Optional - The default value to return if the key does not exist. ### Response #### Success Response - **value** (mixed) - The value associated with the given key, or the default value if the key is not found. #### Response Example ``` "blog" ``` ``` -------------------------------- ### Define fillable attributes in a module model Source: https://laravelmodules.com/docs/13/database/models Use the $fillable property to specify mass-assignable attributes. The example includes a Post model with a datetime cast for published_at. ```php 'datetime', ]; } ``` -------------------------------- ### Generate Blog module with Inertia (Vue default) Source: https://laravelmodules.com/docs/13/resources/inertia Runs the same module:make command with the --inertia flag using the default 'vue' frontend. The frontend is configured in config/modules.php → inertia.frontend; there is no per-command override. ```bash php artisan module:make Blog --inertia ``` -------------------------------- ### Generate Enum class: module:make-enum Source: https://laravelmodules.com/docs/13/advanced/artisan-commands Generates a new Enum class for a specific module. Example: `php artisan module:make-enum PostStatus Blog`. ```bash php artisan module:make-enum PostStatus Blog ``` -------------------------------- ### Generate console command: module:make-command Source: https://laravelmodules.com/docs/13/advanced/artisan-commands Generates the given console command for the specified module. Example: `php artisan module:make-command CreatePostCommand Blog`. ```bash php artisan module:make-command CreatePostCommand Blog ``` -------------------------------- ### Event service provider class extending EventServiceProvider Source: https://laravelmodules.com/docs/13/basic-usage/service-providers The generated provider extends Illuminate\Foundation\Support\Providers\EventServiceProvider and defines event-listener mappings in the $listen property. This example maps PostPublished to NotifySubscribers. ```php [ NotifySubscribers::class, ], ]; } ```