conserto/pomm-bundle
Symfony bundle providing a pomm service to use the Pomm Model Manager with Symfony. Configure one or more PostgreSQL connections via DSNs, enable optional logging, and access Pomm CLI commands (e.g., model generation and database browsing) through bin/console.
pomm:generate:relation-all) and flexible query building, which accelerates development for data-heavy applications. This contrasts with Doctrine’s rigid ORM or Eloquent’s relational-first approach, offering more granular control over database interactions.my_db1, my_db2), which is valuable for microservices architectures or applications with read/write separation. However, this feature is PostgreSQL-specific and may not extend to other database types without significant customization.parameters.yml and config.yml formats./_pomm) for debugging and schema exploration.pomm.model, pomm.model_layer), aligning with Symfony’s DI best practices.pomm:generate:relation-all command integrates with Symfony’s bin/console, enabling schema-driven development.app/Providers/AppServiceProvider.php).routing_dev.yml must be manually replicated in Laravel’s routes/web.php or replaced with a custom middleware.Fractal or Spatie’s Laravel Data would require adapters to bridge with Pomm’s serializers.bin/console commands would need to be rewritten as Laravel Artisan commands.mysql://). However, this would require testing and validation of Pomm’s PostgreSQL-specific features (e.g., JSON path queries).$model->findWhere('name = $*', [$name])).pomm:generate:relation-all CLI tool critical for productivity? If so, how will it be adapted for Laravel?/_pomm profiler)?parameters.yml)?| Component | Symfony Fit | Laravel Fit | Mitigation Strategy |
|---|---|---|---|
| Dependency Injection | Native support via Symfony’s DI container. | Requires custom binding in AppServiceProvider. |
Use Laravel’s Service Container to register Pomm’s services (e.g., PommManager, ModelManager) as singletons. Example: |
| ```php | |||
| // app/Providers/AppServiceProvider.php | |||
| public function register() | |||
| { |
$this->app->singleton('pomm', function ($app) {
return new PommManager($app['config']['pomm']);
});
}
| **Configuration** | Uses `parameters.yml` and `config.yml` (standard Symfony practices). | Requires adaptation to Laravel’s `.env` and `config/pomm.php`. | Create a **config file** (e.g., `config/pomm.php`) to mirror Symfony’s `config.yml` structure. Example: |
| | | | ```php
// config/pomm.php
return [
'configuration' => [
'my_db1' => [
'dsn' => 'pgsql://'.env('DB_USER').':'.env('DB_PASSWORD').'@'.env('DB_HOST').':'.env('DB_PORT').'/'.env('DB_NAME'),
'pomm:default' => true,
],
],
'logger' => [
'service' => 'logger',
],
];
``` |
| **Routing** | Built-in `/_pomm` dev routes via `routing_dev.yml`. | No direct equivalent; requires custom middleware or routes. | Add a **custom route** in `routes/web.php` to replicate Pomm’s dev tools: |
| | | | ```php
Route::prefix('_pomm')->group(function () {
Route::get('/schema', [PommSchemaController::class, 'show']);
});
``` |
| **CLI Tools** | Integrates with Symfony’s `bin/console` (e.g., `pomm:generate:relation-all`). | Requires custom Artisan commands. | Create a **custom Artisan command** to replicate Pomm’s CLI
How can I help you explore Laravel packages today?