All Projects → wouterj → Wouterjeloquentbundle

wouterj / Wouterjeloquentbundle

Licence: mit
Integrates the Eloquent ORM in the Symfony framework

Projects that are alternatives of or similar to Wouterjeloquentbundle

Routing Bundle
Integrate the CMF Routing component as a Symfony2 bundle: Have the chain router and the dynamic router available in Symfony2
Stars: ✭ 124 (-1.59%)
Mutual labels:  symfony, symfony-bundle
Crauegeobundle
Doctrine functions for calculating geographical distances in your Symfony project.
Stars: ✭ 112 (-11.11%)
Mutual labels:  symfony, symfony-bundle
Liipcachecontrolbundle
DEPRECATED! This bundle is superseded by FOSHttpCacheBundle. A migration guide is in the README of LiipCacheControlBundle
Stars: ✭ 108 (-14.29%)
Mutual labels:  symfony, symfony-bundle
Sonataseobundle
Symfony SonataSeoBundle
Stars: ✭ 106 (-15.87%)
Mutual labels:  symfony, symfony-bundle
Swiftmailer Bundle
Symfony Swiftmailer Bundle
Stars: ✭ 1,558 (+1136.51%)
Mutual labels:  symfony, symfony-bundle
Knppaginatorbundle
SEO friendly Symfony paginator to sort and paginate
Stars: ✭ 1,534 (+1117.46%)
Mutual labels:  symfony, symfony-bundle
Slack Bundle
Symfony bundle integration of the nexylan/slack library.
Stars: ✭ 110 (-12.7%)
Mutual labels:  symfony, symfony-bundle
Easy Doc Bundle
Symfony application documentation generator
Stars: ✭ 99 (-21.43%)
Mutual labels:  symfony, symfony-bundle
Webpack Bundle
Bundle to Integrate Webpack into Symfony
Stars: ✭ 124 (-1.59%)
Mutual labels:  symfony, symfony-bundle
Nelmiocorsbundle
The NelmioCorsBundle allows you to send Cross-Origin Resource Sharing headers with ACL-style per-URL configuration.
Stars: ✭ 1,615 (+1181.75%)
Mutual labels:  symfony, symfony-bundle
Notification Bundle
A simple Symfony bundle to notify user
Stars: ✭ 103 (-18.25%)
Mutual labels:  symfony, symfony-bundle
Passwordstrengthbundle
Symfony Password strength and blacklisting validator bundle
Stars: ✭ 123 (-2.38%)
Mutual labels:  symfony, symfony-bundle
Filemanagerbundle
FileManager is a simple Multilingual File Manager Bundle for Symfony
Stars: ✭ 105 (-16.67%)
Mutual labels:  symfony, symfony-bundle
Vichuploaderbundle
A simple Symfony bundle to ease file uploads with ORM entities and ODM documents.
Stars: ✭ 1,613 (+1180.16%)
Mutual labels:  symfony, symfony-bundle
Fosjsroutingbundle
A pretty nice way to expose your Symfony2 routing to client applications.
Stars: ✭ 1,358 (+977.78%)
Mutual labels:  symfony, symfony-bundle
Liipimaginebundle
Symfony Bundle to assist in imagine manipulation using the imagine library
Stars: ✭ 1,516 (+1103.17%)
Mutual labels:  symfony, symfony-bundle
Event Store Symfony Bundle
Event Store Symfony Bundle
Stars: ✭ 93 (-26.19%)
Mutual labels:  symfony, symfony-bundle
Easy Security Bundle
EasySecurityBundle
Stars: ✭ 95 (-24.6%)
Mutual labels:  symfony, symfony-bundle
Core Bundle
[READ-ONLY] Contao Core Bundle
Stars: ✭ 113 (-10.32%)
Mutual labels:  symfony, symfony-bundle
Symfony Jsonapi
JSON API Transformer Bundle for Symfony 2 and Symfony 3
Stars: ✭ 114 (-9.52%)
Mutual labels:  symfony, symfony-bundle

WouterJEloquentBundle

The WouterJEloquentBundle claims to integrate the Eloquent ORM into the Symfony framework.

If you wish to use the Symfony Serializer with Eloquent Models you can check EloquentSerializer.

Maintained Releases

Only the latest release of this bundle is maintained. Backwards compatible support for new versions of PHP, Symfony and Laravel are considered bug fixes. Dropping support for old versions is considered a feature.

New releases will be made as much as once a week following semantic versioning. The default branch (2.x) will be released as minor or patch version, depending on the changes with the last release (features or only bug fixes).

Installation

Step 1: Download the Bundle

Open a command console, enter your project directory and run 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.

When you want to use useful make commands (e.g. make:model), also make sure you have the Symfony MakerBundle installed.

Step 2: Enable the Bundle

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 app/AppKernel.php file of your project:

<?php
// config/bundles.php

return [
    // ...
    WouterJ\EloquentBundle\WouterJEloquentBundle::class => ['all' => true],
];

Step 3: Configure the Database

To use the Eloquent ORM, configure a connection by setting the correct environment variables in .env.local:

# .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.

Table of Content

  1. Installation
    1. Step 1: Download the Bundle
    2. Step 2: Enable the Bundle
    3. Step 3: Configure the Database
  2. Usage
    1. Query Builder
    2. Eloquent ORM
    3. Using Services instead of Facades
  3. Migrations and Seeding
    1. Running seeders
    2. Setting up
    3. Generating migrations
    4. Running migrations
    5. Rolling migrations
    6. Refreshing the database
  4. Using Models in Forms
    1. Binding the Object to the Form
    2. Form Type Guessing
    3. Form Validation
  5. Events and Observers
    1. Register Listeners
    2. Observers
      1. Observers as Services
  6. Configuration
    1. Full configuration
    2. Connections
      1. Drivers
      2. Default connection
    3. Eloquent
    4. Aliases
  7. License
  8. Contributing
  9. Backwards Compatibility

License

This project is licensed under the MIT license. For more information, see the license file included in this bundle.

Contributing

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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].