Download the PHP package kraicdesign/eloquent-bundle without Composer

On this page you can find all versions of the php package kraicdesign/eloquent-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package eloquent-bundle

EloquentBundle

Wires Laravel's Eloquent (Illuminate Database) into the Symfony container, and adds database:migrate and database:migrate:rollback console commands.

Useful when you want Eloquent's query builder, models, and migrations inside a Symfony application — migrating away from Laravel, or simply preferring Eloquent's ergonomics over Doctrine.

Requirements

Installation

If you are not using Symfony Flex, register the bundle manually:

Configuration

Options

Option Default Description
default_connection default Which entry in connections is the default.
connections required Map of connection name to Illuminate connection config. Keys are passed through untouched, so any driver Illuminate supports works.
migrations.path %kernel.project_dir%/database/migrations Where migration files live.
migrations.table migrations Table recording applied migrations.
migrations.connection default Connection migrations run against. default resolves to default_connection.

At least one connection is required.

Usage

Dependency injection

The bundle registers these services, all private, so you type-hint them normally:

Type-hint Resolves to
Kraicdesign\EloquentBundle\Contract\DatabaseConnection the recommended, focused default-connection contract
Kraicdesign\EloquentBundle\Contract\SchemaInspector the recommended schema-inspection contract
Illuminate\Database\ConnectionInterface the default connection
Illuminate\Database\Connection the default connection
Illuminate\Database\Capsule\Manager the Capsule itself

For application services, prefer DatabaseConnection. It exposes the commonly used query and transaction operations together with getSchemaBuilder(), whose SchemaInspector result provides hasTable() and hasColumn() without coupling callers to Illuminate's large concrete connection and schema-builder classes. It also exposes disconnect() to release the underlying PDO; later queries transparently reconnect when needed.

The existing Illuminate connection type-hints remain available and resolve exactly as before. The focused contracts are intentionally not wrappers around the entire Illuminate query API: table() returns Illuminate\Database\Query\Builder, and raw() returns Illuminate\Database\Query\Expression by design.

Adding disconnect() in v1.2.0 is additive for consumers, but technically breaking for external implementations of DatabaseConnection, which must add the new method.

Eloquent models

Capsule::setAsGlobal() and bootEloquent() are called during container compilation, so Eloquent models work without further setup:

Migrations

Migration files use the standard Illuminate format:

The migrations table is created automatically on first run.

Design notes

Eloquent is registered globally. CapsuleFactory::create() calls setAsGlobal() and bootEloquent(). This is what makes Model::query() work anywhere without injecting the Capsule, and it is the behaviour most people want from Eloquent. The trade-off is a process-wide static: the bundle supports several named connections, but only one Capsule, and that Capsule is global. If you need two isolated Capsules in one process, this bundle is not the right fit.

No Doctrine interop. This bundle does not integrate with Doctrine ORM, the Doctrine bundle's migrations, or doctrine/dbal. It is a standalone path.

Connection config is passed through verbatim. The connections node uses a variable prototype with normalizeKeys(false), so Illuminate options are not validated or transformed by this bundle. Anything Illuminate accepts works; typos surface as Illuminate errors rather than Symfony config errors.

Contributing

Issues and pull requests are welcome. Please keep changes focused, and add a test for behaviour changes.

License

MIT — see LICENSE.


All versions of eloquent-bundle with dependencies

PHP Build Version
Package Version
Requires php Version >=8.2
illuminate/database Version ^11.0 || ^12.0 || ^13.0
illuminate/filesystem Version ^11.0 || ^12.0 || ^13.0
symfony/config Version ^6.4 || ^7.0 || ^8.0
symfony/console Version ^6.4 || ^7.0 || ^8.0
symfony/dependency-injection Version ^6.4 || ^7.0 || ^8.0
symfony/http-kernel Version ^6.4 || ^7.0 || ^8.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package kraicdesign/eloquent-bundle contains the following files

Loading the files please wait ...