PHPackages                             atrauzzi/laravel-doctrine - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. atrauzzi/laravel-doctrine

Abandoned → [laravel-doctrine/orm](/?search=laravel-doctrine%2Form)ArchivedLibrary[Database &amp; ORM](/categories/database)

atrauzzi/laravel-doctrine
=========================

An ORM for a Framework for Web Artisans

1.0.0(11y ago)11910.2k57[10 issues](https://github.com/atrauzzi/laravel-doctrine/issues)[2 PRs](https://github.com/atrauzzi/laravel-doctrine/pulls)2MITPHPPHP &gt;=5.3.0

Since Jan 22Pushed 9y ago1 watchersCompare

[ Source](https://github.com/atrauzzi/laravel-doctrine)[ Packagist](https://packagist.org/packages/atrauzzi/laravel-doctrine)[ RSS](/packages/atrauzzi-laravel-doctrine/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependencies (3)Versions (2)Used By (2)

Laravel Doctrine
----------------

[](#laravel-doctrine)

[![Join the chat at https://gitter.im/atrauzzi/laravel-doctrine](https://camo.githubusercontent.com/abe08b740a4156153736f791393ec4da6619c4be73212e75769f52edacc0e2b5/68747470733a2f2f6261646765732e6769747465722e696d2f4a6f696e253230436861742e737667)](https://gitter.im/atrauzzi/laravel-doctrine?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/24c60218af940125ba41f86347340f6f79019f7346a829b7d00273e0e41869e8/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f61747261757a7a692f6c61726176656c2d646f637472696e652f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/atrauzzi/laravel-doctrine/?branch=master) [![Build Status](https://camo.githubusercontent.com/42bc16e51272063a4ebb5d0f5caa8e62fd545f463833bbd8283afa6189a39ed8/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f61747261757a7a692f6c61726176656c2d646f637472696e652f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/atrauzzi/laravel-doctrine/build-status/master)[![SensioLabsInsight](https://camo.githubusercontent.com/c2812aae34e5727e1d2d02fb98a5c1ad6f773554bcddb5340748d6cd22d85079/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f61616661363166662d376530312d346331612d626536312d3739336635623034636433352f6d696e692e706e67)](https://insight.sensiolabs.com/projects/aafa61ff-7e01-4c1a-be61-793f5b04cd35)

### This library is succeeded by [laravel-doctrine/orm](https://github.com/laravel-doctrine/orm)

[](#this-library-is-succeeded-by-laravel-doctrineorm)

#### Though this library is NOT abandoned a more feature-complete and up to date alternative is available at **[laravel-doctrine/orm](https://github.com/laravel-doctrine/orm)**. Check it out!

[](#though-this-library-is-not-abandoned-a-more-feature-complete-and-up-to-date-alternative-is-available-at-laravel-doctrineorm-check-it-out)

### An ORM for a Framework for Web Artisans

[](#an-orm-for-a-framework-for-web-artisans)

Laravel's Eloquent ORM is excellent for lightweight use, however there's little out there that can beat [Doctrine](http://goo.gl/oWVD3) when you need a more full-featured ORM.

This is an integration of Doctrine 2.x to Laravel as a [composer](http://goo.gl/gp9HO) package. Doctrine's `EntityManager` instance is accessible through a facade named `Doctrine` as well as via dependency injection.

Metadata is obtained via the [annotation driver](http://goo.gl/dHy9a) or a custom *config* driver that leverages a Laravel-like configuration syntax.

#### Installation

[](#installation)

Installation is the usual for Laravel packages.

Insert the following configs in your `composer.json`:

```
"minimum-stability": "dev",
"prefer-stable": true
```

In the packages section (require):

```
"atrauzzi/laravel-doctrine": "dev-master"
```

After that, just run a `composer update`

Add the service provider to your Laravel application in `config/app.php`. In the `providers` array add:

```
Atrauzzi\LaravelDoctrine\ServiceProvider::class,
```

If desired, add the following to your `facades` array in the same file:

```
'EntityManager' => Atrauzzi\LaravelDoctrine\Support\Facades\Doctrine::class,
```

You need to run this command publish package configuration.

`php artisan vendor:publish --provider="Atrauzzi\LaravelDoctrine\ServiceProvider" --tag="config"`

#### Usage

[](#usage)

You can obtain the `EntityManager` instance for your connection simply by using the `Doctrine` facade:

Adapted from [Doctrine's documentation](http://goo.gl/XQ3qg):

```
