Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Symfony Mongo Maker Bundle

Symfony Mongo Maker Bundle Laravel Package

ama/symfony-mongo-maker-bundle

View on GitHub
Deep Wiki
Context7

Mongo documents, DTO and controllers crud makers with nelmio-api-doc autogenerated

Frequently asked questions about Symfony Mongo Maker Bundle
Can I use this Symfony MongoDB maker bundle directly in Laravel?
No, this bundle is tightly coupled with Symfony’s architecture (Doctrine ODM, maker-bundle, NelmioApiDoc) and won’t work in Laravel without significant refactoring. Laravel uses Eloquent or jenssegers/mongodb, not Doctrine ODM, and its CLI system (Artisan) differs from Symfony’s Console.
What’s the best Laravel alternative for auto-generating MongoDB CRUD controllers?
For Laravel, use jenssegers/mongodb for MongoDB models, then scaffold controllers manually or with custom Artisan commands. For DTOs, Spatie’s Data Transfer Objects or Laravel API Resources are better fits. OpenAPI docs can be handled with spatie/laravel-api-docs or DarkaOnline/L5-Swagger.
Does this bundle support Laravel’s Eloquent ORM?
No, the bundle relies on Doctrine MongoDB ODM, which isn’t compatible with Laravel’s Eloquent. If you need MongoDB in Laravel, jenssegers/mongodb (a driver wrapper) is the closest alternative, but it lacks ODM features like embedded documents or Doctrine’s query builder.
Can I reuse the DTO generation logic from this bundle in Laravel?
The DTO generation logic is Symfony-specific (e.g., annotations, maker-bundle templates). You’d need to rewrite it for Laravel using Spatie’s DTO package or Laravel API Resources, which follow Laravel’s conventions. The CLI workflow would also require adaptation to Artisan commands.
Will this bundle work with Laravel’s API resources for RESTful endpoints?
No, the bundle generates Symfony-style controllers with #[Route] annotations, while Laravel uses Route::apiResource or manual route definitions. You’d need to manually map the generated templates to Laravel’s routing system, which isn’t straightforward.
How do I generate OpenAPI/Swagger docs in Laravel like this bundle does with NelmioApiDoc?
Use spatie/laravel-api-docs or DarkaOnline/L5-Swagger for Laravel. These packages auto-generate OpenAPI specs from Laravel’s routes, controllers, and annotations, similar to NelmioApiDoc but tailored for Laravel’s ecosystem.
Is Doctrine MongoDB ODM worth the effort to integrate this bundle into Laravel?
Only if you specifically need Doctrine’s ODM features (e.g., embedded documents, complex queries). For most Laravel apps, jenssegers/mongodb (a simpler MongoDB driver) or Eloquent suffices. Integrating Doctrine ODM would require bridging Symfony’s DI system with Laravel’s, adding complexity.
Can I use this bundle’s CLI commands in Laravel with some tweaks?
The bundle’s CLI commands rely on Symfony’s Console and DependencyInjection components, which aren’t compatible with Laravel’s Artisan. You’d need to rewrite the commands from scratch using Laravel’s Console tools, which would negate the bundle’s convenience.
What’s the performance impact of using this bundle’s generated code in Laravel?
The bundle’s generated code (e.g., controllers, DTOs) isn’t optimized for Laravel’s performance patterns. Hand-written Laravel controllers or manually scaffolded code using jenssegers/mongodb or Eloquent will likely perform better and integrate more cleanly with Laravel’s caching and service container.
Are there Laravel packages that combine MongoDB, DTOs, and OpenAPI like this bundle?
No single package replicates all three features, but you can combine jenssegers/mongodb (MongoDB), Spatie’s DTOs (data transfer objects), and spatie/laravel-api-docs (OpenAPI) for a similar workflow. This approach is more maintainable and aligned with Laravel’s ecosystem than forcing this Symfony bundle to work.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
comsave/common
alecsammon/php-raml-parser
chrome-php/wrench
lendable/composer-license-checker
typhoon/reflection
mesilov/moneyphp-percentage
mike42/gfx-php
bookdown/themes
aura/view
aura/html
aura/cli
povils/phpmnd
nayjest/manipulator
omnipay/tests
psr-mock/http-message-implementation
psr-mock/http-factory-implementation
psr-mock/http-client-implementation
voku/email-check
voku/urlify
rtheunissen/guzzle-log-middleware