Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

xingfucoder's avatar

Possibility of Lessons Serie about Laravel & Doctrine

Hi @JeffreyWay, is there any possibility to get any Lessons Serie about Doctrine and Laravel and their integration?

Thanks in advanced.

0 likes
33 replies
bacondrinker's avatar

I may be completely wrong here, but considering all of the awesome stuff that deserve tutorials I would think this is fairly low on the list of things to do. Stuff like an in depth series on testing and the laravel 4.3 series are much higher on the list of things to do.

I would say that with some decent PHP and Laravel knowledge doing this shouldn't be too hard at all. All it really requires is reading of some documentation, and then figuring out how to place that into the world of Laravel.

That being said, there are already more than likely articles already this very subject.

I hope this is at least some what constructive, or helpful? Probably not...

xingfucoder's avatar

Sorry, but maybe you don't undestand my possibility request, for some things about it:

  1. I'm not the unique that would found useful it. If you have this knowledge is great. I just saw some people proposed it before: https://laracasts.uservoice.com/forums/222737-general/suggestions/6216614-laravel-and-doctrine sorry for the repeat.

  2. Sorry if I shouldn't request here, but only asked for the "possibility", not more. Maybe I should not put in the request.

  3. If you have another preferences, sorry it only was a possibility question.

  4. I only asked it, I don't mentioned the list of things to do.

5.I told about serie because I think that the integration process is easy but a real sample would require more chapters as install process, annotations (as shown today if I was not wrong), and so much. But if not possible it, maybe any minimal part of a lesson integrating in a real situation could be useful.

Maybe should I request in the proper way, using the request site of Laracast? This only was a question when I saw the use of Doctrine and some features above Eloquent. And my question was if would be possible this.

Anyway, sorry for making a simple proposal.

bacondrinker's avatar

@codeatbusiness You should not be sorry about making a suggestion, this discussion forum is a more than okay place to put suggestions.

I may have come across as strong, but all I'm really trying to say is that it is unlikely to happen any time soon. Doctrine is a great ORM / DBAL, and I do enjoy using it myself, but integrating it shouldn't be too hard and I'm sure there are articles / screencasts out there about the subject already.

Sorry for coming across strongly :)

xingfucoder's avatar

Don't worry you are welcome :-) @bacondrinker

Only the true is that the way as @JeffreyWay make any integration using some real sample, was the reason for make this possibility request and thought that could be very interesting.

But repeat it, don't worry and thanks for your reply.

konfine's avatar

I'd also be keen on seeing a lesson on best practices using Doctrine as the chosen ORM over Eloquent. I've been using Doctrine in all of my Codeigniter apps and now I've switched over to Laravel it would certainly be helpful to see what Jefferey considers best practice when using another ORM within Laravel rather than Eloquent.

I think Jefferey also mentioned he'd do this in the comments of one of the screencasts I've watched on using Eloquent.

xingfucoder's avatar

Many thanks to all.

@Konfine thanks for your reply.

@JeffreyWay, would be very useful, but only when you are ready for it and if you think that it may be useful for the community, having present the priorities of another lessons or series.

@Francesco Zaffaroni, many thanks I know that, and is one of the reason I thought that may be very useful get some lesson about it. Thanks for sharing.

dberry's avatar

+1 on this, not just on implementing other orms, but specifically doctrine and the data mapper pattern versus eloquent and it's active record pattern. I think this is just another layer that could tie-in with other tuts that talk about separating domain logic.

5 likes
outboundexplorer's avatar

I watched your live Hangout on Google+ last night and was quite intrigued by the limitations of using Eloquent when my database applications become more complex and vast. I have seen several people suggest that Doctrine 2 is more suitable for larger applications. Personally, i really enjoy your teaching style and personal insights on all the material that you cover. Could this be an interesting series for working with Doctine 2 on more complex database applications?

3 likes
vvinhas's avatar

+1 for that.

I would like to see a Doctrine 2 series here in Laracasts.

richbreton's avatar

I would go completely bananas for a doctrine screencast personally +100000

richbreton's avatar

I feel like I watched a bunch of screencasts on repos and thats great but they dont seem to get super powerful without a datamapper to hydrate them. Also I think Doctrine uses UoW and that would be an interesting idea to learn about.

Maximus's avatar

I agree, I absolutely love your casts, I have some experience with doctrine and symfony, but that's still not enough... I'm fighting with using this package right now: https://github.com/mitchellvanw/laravel-doctrin

for anyone who's interested have in doctrine with laravel, at least before we get first amazing (I believe) lara cast: http://culttt.com/tag/cribbb/page/3/ - good tutorials, starting on top of page 3 and then page 2 and page 1... good luck guys/girls :D

cyrax's avatar

I am one of those who would be very interested in doctrine tutorials.

JeffreyWay's avatar

Honestly, I have mixed feelings on Doctrine. I always have to worry that, if I do a Doctrine series, that will suggest that I recommend users embrace Doctrine for all of their apps....and I generally don't.

What people say is that ActiveRecord/Eloquent is great for small projects. That's BS. Eloquent works beautifully for the huge majority of the apps that most of us will build.

Doctrine has its place, and we might eventually cover it on the site, but not in the next quarter.

3 likes
xingfucoder's avatar

Hi @JeffreyWay, thanks for your reply, I think the big problem here, to think about using Doctrine, is disconnecting the Domain Layer from the Eloquent Models because they could be considered as Persistant Layer within our project, correct me if I'm wrong.

I think that Eloquent Models are great for small, medium and large projects but the problem come when you need to isolate your Domain Layer from the rest of the application, with Doctrine you are using POPO (Plain Old PHP Object) or pure Value Objects and Entities (or Aggregate Roots) and with Doctrine you persist disconnecting your Domain Entities from the Datasource.

JeffreyWay's avatar

@codeatbusiness - Just be aware of the compromises you'll make to achieve that purity of separation....for an app that very likely doesn't require it.

2 likes
bellaratmelia's avatar

Sorry for being random everyone @jefferyWay Seems that i cant post question due to the "are you human" validation. I believed PHP is the server side technology for Laravel. Correct me if i am wrong.

bellaratmelia's avatar

@JeffreyWay

I just submitted the question with PHP and php. Both lead me to this error =/ Validation Failed! Click the "Start a Conversation" button again to access your question.

JeffreyWay's avatar

@bellaratmelia - Hmm, very odd. I just checked out your account (as an adminstrator) and created a test forum thread (which I've deleted). All worked perfectly. I'm honestly not sure what the problem could be. People are creating threads left and right this morning, so I'll have to research what might be happening on your end.

jekinney's avatar

@frezno beautifully stated.

I agree with Jeffery, just as with 90% of problem solving in code can in theory be done 200 different was and as long as it works it's fine.

I have used doctrine a time or too and it has it place. But Eloquent generally speaking is above and beyond what 90% of projects need. It comes down to your preferences and imo not pro's and con's.

1 like
jhuliano's avatar

+1 for this, I have the feeling that using Doctrine would be a big improvement for large scale projects. Right now there are not many examples/tutorials of Laravel + Doctrine, also I love how @jefferyWay explains advanced stuff.

Next

Please or to participate in this conversation.