Implementing the Eloquent ORM into Symfony
The WouterJEloquentBundle claims to integrate the Eloquent ORM into the Symfony framework.
This bundle supports Symfony 4.4 and Laravel ^6.18.
Contribute to this repository to this repository if you want to add support for other versions.
Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:
$ composer require wouterj/eloquent-bundle
This command requires you to have Composer installed globally, as explained in the installation chapter of the Composer documentation.
If you're using Symfony Flex, the previous step already got
you up and running and you can skip this step! Otherwise, enable the bundle
by adding it to the list of registered bundles in the
file of your project:
<?php // config/bundles.php return [ // ... WouterJ\EloquentBundle\WouterJEloquentBundle::class => ['all' => true], ];
To use the Eloquent ORM, configure a connection by setting the correct environment
# .env.local DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=symfony DB_USERNAME=root DB_PASSWORD=s3cr3t
If you're not using Symfony Flex, create the configuration file yourself:
# config/packages/eloquent.yaml wouterj_eloquent: driver: mysql host: localhost database: db_name username: root password: pass prefix: ~
For more information, refer to the documentation below.
- Migrations and Seeding
- Using Models in Forms
- Events and Observers
- Backwards Compatibility
This project is licensed under the MIT license. For more information, see the license file included in this bundle.
I love contributors. You can submit fixes, report bugs, share your opinion, advocate this bundle or just say "hello". I welcome anything that makes this project better.