About a year ago, I released a Doctrine2 provider for Laravel 4. We’ve just updated this as a new package for Laravel 5. Full details can be seen in the project’s README.md.
This package creates four bindings into Laravel’s IoC:
Doctrine\ORM\EntityManagerInterface(which is an instance of Doctrine\ORM\EntityManager), also available via the
Doctrine\Common\Cache\Cache(which is an instance of the appropriate cache provider), also available via the
Doctrine\ORM\Mapping\ClassMetadataFactory(used in this package by the console generator commands); and
Doctrine2Bridge\Support\Repositoryhelper object which used by the
D2Rfacade to instantiate repositories such as
D2R::r( 'User' ).
An example of using the
D2Cache::save( $key, $value ); D2Cache::fetch( $key ); $object = new Entities\Object; D2EM::persist( $object ); D2EM::flush();
It includes support for Laravel’s authentication system by way of a Doctrine2 based user provider with some example classes. Simply put – this allows a Doctrine2 database table storing users’ usernames and passwords to be used as the backend for Laravel 5 authentication.
Full documentation of the authentication with examples can be found here.