PHP: Help with OOP and Laravel confusion

Jangga

Junior Member
Joined
Aug 8, 2016
Messages
196
Reaction score
11
Please guys, I want to start learning Laravel. But going over the tutorial videos, I can't see where oop techniques is been used. What is then the importance of learning oop? Why can't I just move from procedural to Laravel?

It seems Laravel uses new terms entirely because I can't see any correlation with oop... Please, share your views
 
@Jangga
Lavarel is mostly object oriented. You can't just move from procedural to object oriented by using the framework alone. You need to learn object oriented programming.

I happen to know the perfect book for you: "PHP Objects. Patterns and practice" by Matt Zandstra. With this book you'll learn object oriented programming and the concepts surrounding it. It's written exactly for people like you who want to move from procedural to object oriented. It'll change the way you think.

However you must know php in order to understand that book. If you dont fully know php then it'd be better if you started with "Programming php" book first.
 
Last edited:
Laravel fundamental is MVC and OOP. There is no way you're using Laravel without it.
If you didn't see any OOP in Laravel, I suggest you to learn more about what is OOP.
 
@Jangga
Lavarel is mostly object oriented. You can't just move from procedural to object oriented by using the framework alone. You need to learn object oriented programming.

I happen to know the perfect book for you: "PHP Objects. Patterns and practice" by Matt Zandstra. With this book you'll learn object oriented programming and the concepts surrounding it. It's written exactly for people like you who want to move from procedural to object oriented. It'll change the way you think.

However you must know php in order to understand that book. If you dont fully know php then it'd be better if you started with "Programming php" book first.
Thanks man.... I really appreciate. Is there really any need to learn design patterns before mvc? Personally, I don't see need since I can sure cook up my flow when coding... Wat u think?
 
Procedural makes sense when you have small applications. When the app gets bigger and bigger, just by using methods you will get lost, no doubt about that.

MVC is a great way to split your app into three major parts: model, view and controller.
The model contains classes like: account, book, order, simple things.
View handles the UI.
Controller puts them all together.

Back in the ways when I didn't knew MVC either, I felt the same thing, why do I need MVC ?
When you get to it though, and you understand it, you'll see that it makes much more sense.

As it was suggested above, learn MVC before learning any framework, will be better for you, since most framework are built with MVC in mind.
Search on youtube, php MVC, pretty sure you'll find plenty of good info there.
 
Procedural makes sense when you have small applications. When the app gets bigger and bigger, just by using methods you will get lost, no doubt about that.

MVC is a great way to split your app into three major parts: model, view and controller.
The model contains classes like: account, book, order, simple things.
View handles the UI.
Controller puts them all together.

Back in the ways when I didn't knew MVC either, I felt the same thing, why do I need MVC ?
When you get to it though, and you understand it, you'll see that it makes much more sense.

As it was suggested above, learn MVC before learning any framework, will be better for you, since most framework are built with MVC in mind.
Search on youtube, php MVC, pretty sure you'll find plenty of good info there.

By MVC, do u mean design patterns?
 
Thanks man.... I really appreciate. Is there really any need to learn design patterns before mvc? Personally, I don't see need since I can sure cook up my flow when coding... Wat u think?

You don't need to at your current level. It would be really helpful for you to learn a bit more the language, this is why I recommended the books above, because they're relatively easy to learn and they teach what you need to understand and more to use a full stack framework such as Laravel.
 
OOP covers building scalable custom functions to avoid writing long codes, which are not reusable.
 
OOP covers building scalable custom functions to avoid writing long codes, which are not reusable.
Please, wat do u actually mean by 'scalable' ? I often hear this word in developers discussion
 
Back
Top