Installation in Laravel 5+
Install this package with composer:
composer require "laravel-doctrine/orm:1.0.*"
After updating composer, add the ServiceProvider to the providers array in
Optionally you can register the EntityManager, Registry and/or Doctrine facade:
'EntityManager' => LaravelDoctrine\ORM\Facades\EntityManager::class, 'Registry' => LaravelDoctrine\ORM\Facades\Registry::class, 'Doctrine' => LaravelDoctrine\ORM\Facades\Doctrine::class,
To publish the config use:
php artisan vendor:publish --tag="config"
Available environment variables inside the config are:
Important: By default, Laravel's application skeleton has its
Modelclasses in the
app/folder. With Doctrine, you'll need to create a dedicated folder for your
Entitiesand point your
pathsarray to it. If you don't, Doctrine will scan your whole
app/folder for files, which will have a huge impact on performance!
'paths' => [ base_path('app/Entities'), ],