Weave 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

Silex Capsule Eloquent Laravel Package

jguyomard/silex-capsule-eloquent

Integrates Laravel's Eloquent ORM into Silex through a service provider that bootstraps the Illuminate Capsule, registers the database manager in the container, and lets you use Eloquent models and the query builder in your Silex app.

View on GitHub
Deep Wiki
Context7

Getting Started

  • Install with Composer (composer require <vendor>/<package>). In Laravel, the service provider is auto-discovered; if you disable discovery, add it to config/app.php (or bootstrap/providers.php on Laravel 11+).
  • Publish any config or assets if the package exposes them: php artisan vendor:publish --provider="<Vendor>\<Package>\<Package>ServiceProvider".
  • First use case: run the package’s primary Artisan command to confirm wiring, then open the service provider (src/Providers/*ServiceProvider.php) to see bindings, singletons, and registered commands.
  • New in v2.0.2: the service provider can now be used inside a standalone Symfony Console application. If you are integrating outside Laravel, start by reading the provider’s register() and boot() methods to see which Laravel contracts and helpers it expects, then bootstrap a compatible container before registering the provider and adding the package commands to your Symfony Application.

Implementation Patterns

  • Standard Laravel usage: rely on auto-discovery, inject package services through the container, and call package commands from your own code with $this->call() or Artisan::call(). Schedule them with Schedule::command().
  • Composition over duplication: wrap package commands in your own command classes when you need pre-flight checks, logging, or tenant-specific arguments; keep the package command as the single implementation.
  • Configuration-driven behaviour: publish the config file, override values through env vars, and bind interfaces in your own provider after the package provider if you need to swap implementations.
  • Standalone Symfony Console (2.0.2+): create a small bootstrap that instantiates a container satisfying the Laravel contracts the provider uses, calls register() and boot(), then registers the package’s commands on Symfony\Component\Console\Application. This is useful for CI scripts, non-Laravel services, and CLI tools that want the package’s behaviour without a full Laravel app.
  • Testing: in Laravel use $this->artisan(); in standalone Symfony use CommandTester against the configured Application. Test both the happy path and the provider boot path, since the latter is what changed in 2.0.2.
  • Extension points: decorate bindings, extend command classes, and listen for package events rather than forking the package. Check the provider for tagged bindings or config-driven command registration before overriding.

Gotchas and Tips

  • The 2.0.2 change makes the service provider compatible with Symfony Console; it does not add automatic command discovery outside Laravel. You still need to register commands manually on the Symfony Application.
  • The provider may type-hint Illuminate\Contracts\Foundation\Application or use app()/config() helpers. In a standalone Symfony app, bind those contracts or use an Illuminate\Container\Container instance; otherwise boot() will fail even though registration succeeds.
  • Don’t assume provider boot order outside Laravel. Check for deferred providers and provides(); call boot() explicitly after all bindings are in place.
  • Auto-discovery only works in Laravel. In Symfony Console, manual registration is required, and config caching is not available — environment handling may differ from your Laravel setup.
  • Version constraints matter: 2.0.2 is a patch release, so update from 2.0.0/2.0.1 freely. If you are on 1.x, review the 2.0 upgrade notes before jumping, as the major version may include breaking changes.
  • Debug with -vvv and inspect the registered provider list (php artisan about --only=providers in Laravel). In standalone Symfony, enable verbose error output and verify the container has the bindings the provider expects.
  • Watch for global helper usage inside the provider — it is the most common cause of failures when reusing the provider outside a full Laravel application.
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.
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource