dongyue7796 2019-08-10 02:27
浏览 225

我们为什么要使用Laravel的服务容器?

I was just learning Laravel via Laracast series. It was going so well until I reach the Service Containers episode. I asked the same question in the laracast comment section but I'm not sure will I get response from there, I think stackoverflow is a better place to look for answers. I found another topic as same as I'm asking here (Laravel 5.7 (Service Container and Service Provider)) but I didn't understand it because it was too complicated for me. Please simplify little more, I'm too beginner for examples like projects that use 'Facebook API' or 'Google API'... Just go with examples like simple blog apps, to-do apps, user-chat apps etc.

Anyway. I will c/p the rest of the question same as I asked in the comments.

The episode that I'm stucked at https://laracasts.com/series/laravel-from-scratch-2018/episodes/21

I actually do understand what he does and how he does but I couldn't get the point of it. My English is not so good so It doesn't matter if I watch it several times again. I understand the system but I don't understand its necessity.

I don't understand how do we use this thing in real life problems. What are the problems that we gonna need to use that app() thing. Like if I want to make a blog page with Laravel, will I gonna need this? Or in which situations I will use it?

I know that's not something about Laravel, It's something about simple programming to interact with other classes and other models but I just don't get it.

Can someone please explain it to us with some example situations and example codes? I (and I'm sure so many more people out there) will be so much appreciate.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 基于卷积神经网络的声纹识别
    • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
    • ¥100 为什么这个恒流源电路不能恒流?
    • ¥15 有偿求跨组件数据流路径图
    • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
    • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
    • ¥15 CSAPPattacklab
    • ¥15 一直显示正在等待HID—ISP
    • ¥15 Python turtle 画图
    • ¥15 stm32开发clion时遇到的编译问题