(858) 586 7777 | About | Testimonials | Contact
vteams vteams vteams vteams
  • How does it work?
    • Startup Process
    • Your First Day
  • Technologies
    • Hire PHP Developer
    • Hire App Developer
    • Hire JavaScript Developer
    • Hire ROR Developer
    • Hire IOS Developer
    • Hire .NET Developer
    • Hire AI Developer
    • Hire Robotics Engineer
  • Sample Budgets
  • Meet The Team
  • Experiments
  • Captain’s Log
  • Blog
vteams vteams
  • How does it work?
    • Startup Process
    • Your First Day
  • Technologies
    • Hire PHP Developer
    • Hire App Developer
    • Hire JavaScript Developer
    • Hire ROR Developer
    • Hire IOS Developer
    • Hire .NET Developer
    • Hire AI Developer
    • Hire Robotics Engineer
  • Sample Budgets
  • Meet The Team
  • Experiments
  • Captain’s Log
  • Blog
Blog
  1. vteams
  2. Blog
  3. Setting Up Doctrine2 ORM with Laravel 5
Jan 06
setting-up-doctrine2-orm-with-laravel-5

Setting Up Doctrine2 ORM with Laravel 5

  • January 6, 2017

The Object Relational Mapper (ORM) for PHP sits on top of a powerful DataBase Abstraction Layer (DBAL). One of its key features is the option to write database queries in a proprietary, object oriented, SQL dialect called Doctrine Query Language (DQL), inspired by Hibernates HQL. This provides developers with a powerful alternative to SQL that maintains flexibility without requiring unnecessary code duplication.

To set up Doctrine, there is a bridge that allows you to perform a matching action with Laravel 5’s existing configuration. In order to install Doctrine2 within your Laravel project, you need to run the following commands step by step:

Step 1: Add the package (delivered by the service provider) to the app/config.php:

1
composer require laravel-doctrine/orm

Step 2: Configure the alias:

1
LaravelDoctrine\ORM\DoctrineServiceProvider::class

Step 3: Publish the package configuration:

1
'EntityManager' => LaravelDoctrine\ORM\Facades\EntityManager::class

Step 4: Doctrine does not require database configuration and uses the current Laravel configuration as:

1
php artisan vendor:publish --tag="config"

But if you want to override the current Laravel configuration, then you should change the code in Config/doctrine.php (Doctrine config file) as:

1
2
3
4
5
6
7
8
'managers'                  => [
    'default' => [
        'dev'        => env('APP_DEBUG'),
        'meta'       => env('DOCTRINE_METADATA', 'annotations'),
        'connection' => env('DB_CONNECTION', 'mysql'),
        'namespaces' => [
            'App'
        ],

And you should be all set!

  • Facebook
  • Twitter
  • Tumblr
  • Pinterest
  • Google+
  • LinkedIn
  • E-Mail

Comments are closed.

SEARCH BLOG

Categories

  • Blog (490)
  • Captain's Log (1)
  • Closure Reports (45)
  • Experiments (7)
  • How-To (56)
  • Implementation Notes (148)
  • Learn More (156)
  • LMS (8)
  • Look Inside (10)
  • Operations Log (12)
  • Programmer Notes (20)
  • R&D (14)
  • Rescue Log (4)
  • Testimonials (25)
  • Uncategorized (4)

RECENT STORIES

  • GitHub Actions- Automate your software workflows with excellence
  • Yii Framework – Accomplish Repetitive & Iterative Projects with Ease
  • A Recipe for CRM Software Development
  • Are Agile and DevOps the same?
  • The Data Scientist’s Toolset

ARCHIVES

In Short

With the vteams model, you bypass the middleman and hire your own offshore engineers - they work exclusively for you. You pay a reasonable monthly wage and get the job done without hassles, re-negotiations, feature counts or budget overruns.

Goals for 2020

  • Open development center in Australia
  • Complete and Launch the Robot
  • Structural changes to better address Clients' needs

Contact Us

Address: NEXTWERK INC.
6790 Embarcadero Ln, Ste 100,
Carlsbad, CA 92011, USA

Tel: (858) 586 7777
Email: fahad@nextwerk.com
Web: www.vteams.com

© 2020 vteams. All Rights Reserved.

Content Protection by DMCA.com