PHPackages                             mitch/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. mitch/laravel-doctrine

Abandoned → [mitchellvanw/laravel-doctrine](/?search=mitchellvanw%2Flaravel-doctrine)Library[Database &amp; ORM](/categories/database)

mitch/laravel-doctrine
======================

The Doctrine 2 implementation that melts with Laravel 4

0.5.0(11y ago)1861.8k72[28 PRs](https://github.com/mitchellvanw/laravel-doctrine/pulls)MITPHPPHP &gt;=5.5.0

Since Mar 25Pushed 10y ago11 watchersCompare

[ Source](https://github.com/mitchellvanw/laravel-doctrine)[ Packagist](https://packagist.org/packages/mitch/laravel-doctrine)[ RSS](/packages/mitch-laravel-doctrine/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (5)Versions (20)Used By (0)

Doctrine 2 for Laravel (NO LONGER MAINTAINED! Try [laravel-doctrine/orm](https://github.com/laravel-doctrine/orm) instead!)
===========================================================================================================================

[](#doctrine-2-for-laravel-no-longer-maintained-try-laravel-doctrineorm-instead)

[![Latest Stable Version](https://camo.githubusercontent.com/7393a1d9bcf7a217186c159c94a491b808a1df93fa7fa7e602f6447a55ddc3d3/68747470733a2f2f706f7365722e707567782e6f72672f6d69746368656c6c76616e772f6c61726176656c2d646f637472696e652f76657273696f6e2e706e67)](https://packagist.org/packages/mitchellvanw/laravel-doctrine)[![License](https://camo.githubusercontent.com/31f1865e1349e83e6dbc1ee9fce7a601e903ee3123f4aed4ac33a16f46b2b38f/68747470733a2f2f706f7365722e707567782e6f72672f6d69746368656c6c76616e772f6c61726176656c2d646f637472696e652f6c6963656e73652e706e67)](https://packagist.org/packages/mitchellvanw/laravel-doctrine)[![Total Downloads](https://camo.githubusercontent.com/a18b35086b7f2fdfd269befc60b4ffe78c7f3ebb1573ea9dfcf2757691eb7954/68747470733a2f2f706f7365722e707567782e6f72672f6d69746368656c6c76616e772f6c61726176656c2d646f637472696e652f646f776e6c6f6164732e706e67)](https://packagist.org/packages/mitchellvanw/laravel-doctrine)

A Doctrine 2 implementation that melts with Laravel 4.

Documentation
-------------

[](#documentation)

Begin reading [the full documentation](https://github.com/mitchellvanw/laravel-doctrine/wiki) here or go to a specific chapter right away.

1. [Installation](https://github.com/mitchellvanw/laravel-doctrine/wiki/Installation)
2. [How It Works](https://github.com/mitchellvanw/laravel-doctrine/wiki/How-It-Works)
3. [Basics](https://github.com/mitchellvanw/laravel-doctrine/wiki/Basics)
4. [Entity Manager](https://github.com/mitchellvanw/laravel-doctrine/wiki/Entity-Manager)
5. [Timestamps](https://github.com/mitchellvanw/laravel-doctrine/wiki/Timestamps)
6. [Soft Deleting](https://github.com/mitchellvanw/laravel-doctrine/wiki/Soft-Deleting)
7. [Authentication](https://github.com/mitchellvanw/laravel-doctrine/wiki/Authentication)
8. [Schemas](https://github.com/mitchellvanw/laravel-doctrine/wiki/Schemas)
9. [Doctrine Configuration](https://github.com/mitchellvanw/laravel-doctrine/wiki/Doctrine-Configuration)
10. [Metadata Configuration](https://github.com/mitchellvanw/laravel-doctrine/wiki/Metadata-Configuration)
11. [Annotation Reader](https://github.com/mitchellvanw/laravel-doctrine/wiki/Annotation-Reader)
12. [Metadata](https://github.com/mitchellvanw/laravel-doctrine/wiki/Metadata)
13. [MIT License](https://github.com/mitchellvanw/laravel-doctrine/blob/master/LICENSE)

Caveats
-------

[](#caveats)

At the moment Doctrine\\migrations version 1.0 is still in alpha. As a result the composer install may require you to change the `minimum-stability` in your `composer.json` to `dev`.

If you don't want to affect the stability of the rest of the packages, you can add the following property in your `composer.json`:

"prefer-stable": true

Installation
------------

[](#installation)

Begin by installing the package through Composer. Edit your project's `composer.json` to require `mitchellvanw/laravel-doctrine`.

> This package is still in it's early stages, but fully functional. Is it possible that the API might change slightly, no drastic changes.

```
"require": {
    "mitchellvanw/laravel-doctrine": "0.5.*"
}
```

Next use Composer to update your project from the the Terminal:

```
php composer.phar update
```

Once the package has been installed you'll need to add the service provider. Open your `app/config/app.php` configuration file, and add a new item to the `providers` array.

```
'Mitch\LaravelDoctrine\LaravelDoctrineServiceProvider'
```

After This you'll need to add the facade. Open your `app/config/app.php` configuration file, and add a new item to the `aliases` array.

```
'EntityManager' => 'Mitch\LaravelDoctrine\EntityManagerFacade'
```

It's recommended to publish the package configuration.

```
php artisan config:publish mitchellvanw/laravel-doctrine --path=vendor/mitchellvanw/laravel-doctrine/config
```

2 Minutes
---------

[](#2-minutes)

This package uses the Laravel database configuration and thus it works right out of the box. With the [Entity Manager](https://github.com/mitchellvanw/laravel-doctrine/wiki/Entity-Manager) facade (or service locator) you can interact with repositories. It might be wise to [check out the Doctrine 2 docs](http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/index.html) to know how it works. The little example below shows how to use the EntityManager in it simplest form.

```
