soyuka/stubs-mongodb
Laravel stub overrides to generate models/migrations geared for MongoDB usage. Adds MongoDB-friendly boilerplate when running artisan make commands so new classes start with the right base classes, traits, and conventions for jenssegers/mongodb-style projects.
jenssegers/mongodb or spatie/laravel-mongodb) for hybrid or NoSQL use cases.soyuka/stubs-mongodb) and configure PHPStorm’s stubs path in php.ini or IDE settings.ext-mongodb (PHP driver) installed in the environment.ext-mongodb version; mismatches may cause IDE errors.ext-mongodb version used in production.ext-mongodb used directly (e.g., \MongoDB\Client) or via a Laravel package (e.g., jenssegers/mongodb)?
composer.json to prevent IDE breakage across environments?ext-mongodb releases breaking changes? (JetBrains or community?)\MongoDB\Driver\*, \MongoDB\Client, etc.ext-mongodb calls vs. Laravel packages.ext-mongodb version consistency across dev/staging/prod.MongoDB\Connection).CONTRIBUTING.md or DEVELOPMENT.md:
; Add to php.ini or PHPStorm settings
php.stubs = vendor/soyuka/stubs-mongodb/stubs.php
php-stub-builder.ext-mongodb version (e.g., 1.11.0 stubs for mongodb/mongodb:1.11.0).jenssegers/mongodb, stubs won’t cover Jenssegers\Mongodb\*. Consider:
php-stub-builder to generate stubs for the package.| Phase | Task | Owner | Dependencies |
|---|---|---|---|
| Prep | Audit MongoDB usage and ext-mongodb versions. |
Backend Lead | None |
| Pilot | Install stubs in a dev environment and validate. | Dev Team | PHPStorm installed |
| Document | Add setup instructions to onboarding docs. | Tech Writer | Pilot feedback |
| Customize | Extend stubs for Laravel-specific classes (if needed). | TPM/Dev | Laravel package version |
| Rollout | Deploy stubs to all dev environments. | DevOps | Composer dependency added |
ext-mongodb releases a major version (e.g., 2.0.0).ext-mongodb.
Settings > Languages & Frameworks > PHP > Stub Files).client->selectDatabase($db)->$method).
@method annotations in code.ext-mongodb version consistency (optional).phpstan to check for undefined MongoDB methods).| Failure Scenario | Impact | Mitigation Strategy |
|---|---|---|
| Stubs version mismatch | Broken autocompletion | Version-lock stubs in composer.json. |
| PHPStorm stubs path misconfig | Stubs ignored | Document setup with screenshots. |
| Custom MongoDB classes | No IDE support | Generate custom stubs or use @mixin. |
| PHPStorm update breaks stubs | IDE errors | Test stubs against new PHPStorm versions. |
ext-mongodb deprecation |
Stubs become obsolete | Migrate to mongodb/mongodb v2+ stubs. |
File > Settings > PHP > Stub Files).How can I help you explore Laravel packages today?