Home php Using DOCTRINE in Laravel

Using DOCTRINE in Laravel




For work I use Laravel . As many know, the eloquent library is used as orm . The fact is that I read a lot of different articles, where people insisted that using Doctrine Instead of Eloquent , it will be a very good idea. So I decided to go to Doctrine . But there is one problem. How to put Doctrine Instead of Eloquent in Laravel ? I found a library that was specifically written under Laravel http://www.laraveyeldoctrine.org/ but not I know whether it is worth using it, or take from the official website Doctrine . Please tell me how to do it? And with what problems I can meet when using Doctrine Instead of Eloquent in Laravel ?

Answer 1, Authority 100%

How to put DOCTRINE instead of ELOQUENT in Laravel?

via Composer Composer Require Doctrine / ORM . Here is the official guide .

The Laravel Doctrine project is a strapping for the use of the doctrine inside Laravel. At Project site direct text says that makes this package:

  • Simple configuration
  • Papagination
  • Preset Metadata, Connects and Keching
  • Name Strategy as in Laravel
  • Implementation of authorization and recovery passwords
  • … and many other features

It also places it via the composer request "Laravel-Doctrine / ORM: 1.3. *" plus you need a setting, here’s Official guide .

So you have a choice – or put the doctrine yourself, and then integrate – do everything that is stated as the features of Laravel Doctrine, or use this ready-made package. Establish you.

And with what problems I can meet when using the Doctrine instead of ELOQUENT in Laravel

In general, it is useful to watch the source codes. And also – tests.

in tests of this package has validation, which means that it means That the validation from Lara with a naked doctrine will not work. Need to refine.

Next to the list – pagination, configuration, serialization, caching, …, it seems I wrote it above. Just now I watch the tests, and in them this claimed functionality is checked. And requires implementation if you want to use a naked doctrine, but leave the approach eloquent .

Tell me please, how to do it?

Want to figure out how to make friends doctrine and lara? Then install it start using, facing difficulties and solve them. You can check on the source code of the project.

Need a simple way – just put the package. But there, too, not everything is so smooth, see issues on Githabe

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions