- How does Liferaft enforce consistent project structure across a Laravel team?
- Liferaft provides opinionated scaffolding presets that standardize directory layouts, configuration files, and common setup patterns. Teams can define shared conventions in a single package, ensuring all new projects adhere to the same structure without manual repetition. It integrates via Laravel service providers and config, making it easy to enforce during project initialization.
- Can I use Liferaft to package reusable components for multiple Laravel projects?
- Yes, Liferaft is designed to package and share reusable components like middleware, commands, or config presets across projects. By defining these as presets, teams can avoid reinventing the wheel and maintain consistency. Components are distributed via Composer, just like any other Laravel package.
- What Laravel versions does Liferaft support, and how do I check compatibility?
- Liferaft is optimized for Laravel 10+ and PHP 8.1+. Always check the package’s `composer.json` for the latest supported versions or the GitHub repository for updates. If you’re using an older Laravel version, verify compatibility by testing the package in a staging environment before production deployment.
- How do I customize Liferaft’s presets for my team’s specific needs?
- Customize presets by extending Liferaft’s base configuration or creating your own preset classes. Override default behaviors in `config/liferaft.php` or publish and modify the package’s config files. For advanced use cases, you can extend Liferaft’s service providers or commands to add custom logic.
- Does Liferaft work with Laravel Forge, Envoyer, or other deployment tools?
- Yes, Liferaft is deployment-agnostic and integrates seamlessly with tools like Forge, Envoyer, or Deployer. Since it relies on Laravel’s native config and service providers, it doesn’t impose deployment-specific requirements. Just ensure your deployment pipeline includes the package’s Composer dependencies and config publishing steps.
- How can I test Liferaft’s presets before rolling them out to the entire team?
- Test presets in a sandbox Laravel project or a dedicated testing environment. Use `php artisan liferaft:preset:apply` to simulate the setup process and verify that configurations, commands, and structures are applied correctly. Automate testing with PHPUnit or Pest to catch edge cases.
- What happens if a preset conflicts with an existing Laravel project structure?
- Liferaft includes safeguards to prevent destructive overwrites by default. Conflicts are logged as warnings, and you can configure presets to skip or merge changes. Review the `config/liferaft.php` settings for `overwrite_strategy` to control behavior during preset application.
- Are there alternatives to Liferaft for Laravel project scaffolding?
- Alternatives include custom Composer scripts, Laravel Installer, or packages like `laravel-shift/blueprint`. However, Liferaft stands out by combining scaffolding with reusable presets and deep Laravel integration. If you need more flexibility, consider building a custom solution using Laravel’s `make:command` and `make:provider` features.
- How do I handle sensitive data or environment-specific configurations in Liferaft presets?
- Use Laravel’s environment variables (`.env`) and conditional logic in presets to handle environment-specific settings. For sensitive data like API keys, exclude them from presets entirely or use placeholder values that teams must replace manually. Liferaft’s config includes filters to sanitize payloads if needed.
- Can Liferaft be used in a monorepo with multiple Laravel applications?
- Yes, but you’ll need to scope presets to specific applications within the monorepo. Use Composer’s `extra.liferaft` config or custom logic in presets to target the correct Laravel app directory. Test thoroughly to ensure presets don’t interfere with unrelated projects in the same repo.