What is active record pattern & how Laravel implements it with Eloquent - Full PHP 8 Tutorial

preview_player
Показать описание
In this lesson, we go over what an active record pattern is & how Laravel implements it in its ORM package called Eloquent. This lesson also covers the basics of eloquent to get you familiar with it & show you the differences between the data mapper & active record patterns.

SOME OF THE WAYS YOU CAN SUPPORT THE CHANNEL
👍 Smash the like button
🤝 Subscribe to the channel & turn the notifications on
💬 Post comments, any feedback is greatly appreciated
THANK YOU!

🛠️ TOOLS & SERVICES I USE

LESSON 3.19

RESOURCES

** Affiliate Disclaimer: Some of the above links may be affiliate links, which may generate me a sales commission at no additional cost to you.
Рекомендации по теме
Комментарии
Автор

Everyone explains how to use the technique
but
You explain how it works and how it was built
This makes things clearer and easier, and this is the right way

mwaas
Автор

Your lessons are awesome! Good quality, which is not that frequent on youtube. Thank you for your job.

werrew
Автор

I could listen to you all day bro. Thanks for your videos.

perfect.stealth
Автор

man if you do a deep dive like this on laravel your channel will explode

ousssika
Автор

Couple of topics request if you please cover. One is design patterns in PHP, like singleton, factory, etc. And the other one is, maybe a couple of dedicated videos on DSA with PHP. Great great stuff you are covering in your videos!!!

codingzen
Автор

Wow 😄
at 35:42
you talked about the collection from query builder vs collection from Eloquent
I was just reading this in page 106 in Laravel Up & Running, hahaha 😄

I have a daily routine, a part of it is to study from Laravel Up & Running -> then watch Gio video from where I have stopped last time & summarize in notion
I was just reading the same information in the book minutes ago
and then came here to see it exactly the same 😄

omaryahia
Автор

Thank you Gio! This totally makes sense to me as a person coming from a laravel background

emekatimothyiloba
Автор

This is the reason I want native Doctrine support in Laravel..

RealHomeboy
Автор

Wow. Laravel's eloquent is Soo cool... Lots of magic... I'm left wondering how laravel/eloquent implements it's migrations. I believe I'll probably see more of that in the next lesson. Btw, been dreaming and daydreaming of code for a while now. Gio your tutorials are really turning me into a PHP programmer. I appreciate much Gio. I really do.

Zubbee
Автор

One of the best channels I have ever followed .. just one request please could you make a video about the integration tests and the e2e tests

abdelrahmanmagdy
Автор

Great video as always! It's very helpful to see the differences between Eloquent and Doctrine side by side. I personally like both. We use Laravel and Eloquent in a large project without any particular complaints. But while Eloquent, using its magic, makes it easy but a bit messy to work with models and queries, Doctrine feels cleaner and more intuitive. Eloquent provides scope methods to prevent duplication, but it still doesn't allow to separate business logic from queries, which is possible with the Repository pattern and Doctrine (Repository pattern and Eloquent is not a good idea, we tried 🙂). So for projects with complex architecture, I would probably go with Doctrine. Laravel and Eloquent are great for simple projects and especially prototyping. But this is a subjective opinion.
Thank you for your job!

yuriymiroshnychenko
Автор

It's not my tale (Laravel and all around), but as always, great educational and at the same time concise elaboration. I am running out of unique expressions for my appreciation. 😁

constantinci
Автор

This is the first time I'm learning OOP. I can't imagine I would have ever learn to use a framework the right way without knowing all this concepts and how they work. I'm sure you have mentioned many times, but isn't this the objective of the course? So that we are not dependent of a single framework? You mention many times that we should not use this classes and methods on production, witch in my mind sounds like we will end up using framework instead, once we understand what is a framework purpose first.

I totally agree with that statement. If I had tried to learn a specific framework from the start, it probably wouldn't had been feasible, and I would most probably had learned like a parrot without understanding what I was doing.

I started this course late, so I'm lucky there were a lot of your videos already out for me to study, and knowing what I have said above, I most probably should be patience, but I'm not. Would it be OK if I start learning laravel while your next video is out? We haven't touch views for example but I'm sure laravel has a way to handle those too. Any way, I'm not trying to pressure you or anything, I think you are making an incredible job at this rate, but I can't even imagine that we are close to start making things for production any soon. So my plan is to start learning laravel and keep an eye on you new videos, because they most probably help me understand what ever I'll be doing on laravel by that time.

I respect a lot your opinion, so if you want to suggest me otherwise I'll wait. If you have a time frame you believe you end the series I'll be nice to know it too. Thank you.

arielenter
Автор

Do you plan to do videos about implementation of DDD in PHP? I'd love to learn this.

xJuriXPL
Автор

thank you for a great video, as always it has been helpfull, i wanted to ask you what framwork do you recommend learning (laravel, Yii) or some other framwork in a way that will help me get a job ...
i worked with both laravel and yii, both are amazing but i don't have mush experience in them,
so in which of them i should dive in or should i learn some other framework to increase my chances to get a job ??

ibrahemmohammad
Автор

Pourriez vous nous faire un tutoriel sur le framework Laravel ? ça fait bientôt deux ans que je l'utilise mais je suis sûr d'en apprendre encore plus avec vous.

mouhamaddiop
Автор

thanks for the great content once again! don't you think it would be good that Eloquent could have data mapping built in? so that we can access the property field like unitPrice instead of unit_price, unit_price breaks the variable naming convetion in PHP in my opnion, it looks so odd to access a field like $model->unit_price.

bijianwu
Автор

Hi Gio, Thanks for this great video !

I would like to use the save() method on parent / child models over using push() on the parent model,
because I think that the push() method will loop on every relation on the parent model and then it will loop on every model within the relation and then call the push() method on it !
So it should be much slower right ?

obadaalzidi
Автор

When will you make a video on the Design Patterns like factory pattern, middleware etc

rxxt-shvj
Автор

Quick question:
Is there a way to bind a column to a property instead of the one generated by Laravel's active record pattern?
In other terms, replicate the exact behavior of #[Column(name: "column_name"] seen in the data mapping pattern.

ntdash