- Can I use conserto/pomm-cli in a Laravel project that already uses Eloquent for PostgreSQL?
- Yes, but only if you need PostgreSQL-specific features not covered by Eloquent, like advanced JSONB operations, custom types, or procedural SQL. The CLI is designed to complement Pomm, which you’d use alongside Eloquent for specialized tasks. Avoid mixing them for generic CRUD operations to prevent complexity.
- How do I install conserto/pomm-cli in a Laravel project?
- Run `composer require conserto/pomm-cli` in your project root. The package doesn’t integrate directly with Laravel’s Artisan; instead, it provides a standalone CLI tool (`./bin/pomm.php`). You’ll need to configure a bootstrap file (e.g., `.pomm_cli_bootstrap.php`) to initialize Pomm with your PostgreSQL connection details.
- Does conserto/pomm-cli support Laravel’s .env for database configuration?
- No, the CLI is independent of Laravel’s environment files. You must manually configure PostgreSQL connection details in your bootstrap file (e.g., `.pomm_cli_bootstrap.php`) or pass them via command-line arguments. This ensures consistency with Pomm’s design but requires extra setup if you’re using Laravel’s `.env`.
- What Laravel versions and PHP requirements does conserto/pomm-cli support?
- Check the package’s `composer.json` for PHP version constraints (likely 8.1+ based on modern Pomm dependencies). Laravel version compatibility isn’t explicitly enforced, but ensure your PHP version aligns with Laravel’s requirements. The package itself doesn’t interact with Laravel’s core, so version conflicts are minimal.
- Can I use conserto/pomm-cli for database migrations in Laravel?
- Not directly. The CLI is for Pomm-specific tasks like schema inspection or procedural SQL, not Laravel migrations. For migrations, stick to Laravel’s Artisan (`php artisan migrate`). However, you *can* use the CLI to generate Pomm-based migration scripts or inspect schemas before running Laravel migrations.
- How do I run conserto/pomm-cli commands in a CI/CD pipeline?
- Add the CLI to your pipeline as a standalone script (e.g., `./bin/pomm.php pomm:inspect:database`). Store PostgreSQL credentials securely using CI secrets (e.g., GitHub Actions secrets or GitLab CI variables). Avoid hardcoding credentials in the bootstrap file or scripts.
- Are there alternatives to conserto/pomm-cli for PostgreSQL CLI tasks in Laravel?
- For Laravel-specific tasks, use Artisan or packages like `laravel-shift/database-tools`. For Pomm-centric workflows, alternatives are limited—this CLI is the primary tool. If you’re not using Pomm, consider `spatie/laravel-postgres-tools` for PostgreSQL-specific Laravel features without Pomm’s overhead.
- Can I generate Laravel models or migrations from PostgreSQL schemas using this CLI?
- No, the CLI generates Pomm-specific classes (e.g., for procedural SQL or custom types), not Laravel models. For model generation, use Laravel’s `make:model` or tools like `laravel-shift/database-tools`. The CLI’s `generate` commands are tailored to Pomm’s architecture, not Eloquent.
- How do I handle errors or debug issues with conserto/pomm-cli in production?
- Wrap CLI calls in try-catch blocks to log Pomm-specific errors (e.g., connection failures). Use the `--verbose` flag for debugging output. For production, ensure PostgreSQL credentials and bootstrap configurations are validated in staging first. Avoid running long tasks in CLI mode during HTTP requests.
- Does conserto/pomm-cli work with Laravel’s service container or queues?
- No, the CLI is standalone and doesn’t integrate with Laravel’s service container or queues. For long-running tasks, run the CLI in a separate process or use Laravel’s queues to trigger it via a job. Avoid injecting Laravel bindings into Pomm commands to prevent dependency conflicts.