- Can I use contao/manager-plugin in a Laravel project?
- No, this package is designed exclusively for Contao CMS (a PHP-based CMS) and integrates with its Contao Manager. Laravel has its own package management system via Composer and lacks Contao’s Manager API, making direct integration impossible unless Contao is embedded as a subsystem.
- What’s the difference between Contao Manager and Laravel’s package management?
- Contao Manager is a custom package manager for Contao CMS, handling bundle registration, auto-configuration, and dependency resolution within Contao’s Symfony-based framework. Laravel relies on Composer for package management and uses service providers instead of Contao’s `ManagerPluginInterface`.
- How do I register a Contao bundle using this plugin?
- Create a `Plugin` class in `src/ContaoManager/Plugin.php`, implement interfaces like `BundlePluginInterface` or `ConfigPluginInterface`, and register the class path in your `composer.json` under the `extra.contao-manager-plugin` key. This automates bundle registration during Contao’s installation/update process.
- Will this plugin work with Laravel’s Composer autoloader?
- No, the plugin assumes Contao’s autoloader and dependency injection system. Laravel’s autoloader (PSR-4) and service container are incompatible with Contao’s `ManagerPluginInterface`, so this package won’t function in a pure Laravel environment.
- Can I use this plugin if I’m running Contao alongside Laravel in the same app?
- Only if Contao is isolated in a separate namespace or subdirectory with its own vendor/ directory. Even then, you’d need custom routing and potential conflicts between Laravel’s and Contao’s service containers, which isn’t officially supported.
- What Laravel alternatives exist for Contao Manager’s bundle registration?
- For Laravel, use `spatie/laravel-package-tools` to create installable packages with service providers, or `orchestra/platform` for modular package management. These tools handle registration via Laravel’s service container instead of Contao’s Manager API.
- Does this plugin support Contao 4.x and Laravel 10.x together?
- No, this plugin is Contao-specific and doesn’t interact with Laravel. However, if you’re embedding Contao in Laravel, ensure both systems use compatible PHP versions (e.g., Contao 4.x typically requires PHP 7.4–8.1, while Laravel 10.x needs PHP 8.1+). Conflicts may arise in shared dependencies.
- How do I configure Contao Manager plugins for updates or installs?
- Implement interfaces like `InstallationPluginInterface` or `UpdatePluginInterface` in your `Plugin` class to define logic for installation steps, database migrations, or post-update tasks. These are executed automatically by Contao Manager during package lifecycle events.
- Are there performance risks if I use this plugin in a hybrid Laravel/Contao setup?
- Yes, mixing Contao’s ManagerPlugin with Laravel’s service container can cause conflicts, slower boot times, and maintenance overhead. Contao’s auto-registration system may also interfere with Laravel’s lazy-loading or deferred services.
- Where can I find documentation for Contao Manager plugins?
- Refer to the [Contao Manager Plugin documentation](https://github.com/contao/manager-plugin) and the [Contao CMS docs](https://docs.contao.org/) for details on interfaces like `BundlePluginInterface`, `ConfigPluginInterface`, and lifecycle hooks. Laravel-specific resources won’t apply.