- How do I install bchalier/laravel-modules?
- Install it with Composer by requiring bchalier/laravel-modules in your Laravel project. Laravel's package discovery will register the package's service provider automatically, so no manual provider entry is normally needed. After installation, run php artisan list to see the module-related commands the package adds.
- Which Laravel versions does bchalier/laravel-modules support?
- The package is designed for Laravel applications and relies on standard Laravel service providers and Artisan. The exact Laravel and PHP version constraints are declared in the package's composer.json. Check the Packagist page or repository composer.json before installing to confirm compatibility with your app's Laravel version.
- How do I create a new module?
- The package provides Artisan commands for scaffolding and managing modules. After installing, run php artisan list and look for the module-related commands the package registers. A generated module typically includes the basic structure for routes, views, migrations, and a service provider.
- Where do modules live in the application directory?
- Modules are self-contained directories that hold their own routes, views, migrations, and service providers. The package defines a modules location convention and configuration; check the package README or config file for the exact default path. You can usually customize the base path through the package configuration.
- How are module routes and service providers registered?
- Each module can ship its own service provider, which Laravel boots like any other provider. The package discovers and registers module providers, and routes are typically loaded from the module's routes files. Review the package documentation for the exact discovery mechanism and route-loading conventions.
- Can each module have its own migrations?
- Yes, modules are self-contained and can include their own migrations alongside routes, views, and service providers. The package's Artisan tooling manages module migrations, and you can run them through the package's migration commands. Confirm the exact command names in the README for your installed version.
- How do I test a Laravel app that uses modules?
- Module code is ordinary Laravel code, so you can test it with PHPUnit or Pest using Laravel's testing helpers. Make sure the module's classes are autoloadable, either through Composer autoload rules or the package's registration. Test module routes and service providers by hitting endpoints and resolving bindings in feature tests.
- Is bchalier/laravel-modules safe for production?
- It is a lightweight module layer that adds structure rather than a heavy runtime, so it fits production Laravel apps that need clear boundaries. As with any package, pin a tested version in composer.json, run composer dump-autoload and Laravel's config and route caches in deployment, and review the changelog before upgrades.
- How does bchalier/laravel-modules compare to nwidart/laravel-modules?
- Both packages let you split a Laravel application into modules, but they differ in scope and conventions. bchalier/laravel-modules is intentionally lightweight and Artisan-driven, while nwidart/laravel-modules is a larger, widely adopted module suite with more built-in features. Evaluate the directory conventions, commands, and features each offers against your team's needs.
- Is bchalier/laravel-modules actively maintained?
- Maintenance activity is best checked on the GitHub repository and Packagist release history. Look at recent commits, tagged releases, and open issues before adopting it for a long-lived project. Pin a version you have tested and review changes when updating.