🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
Providing The Core 核心也是服务提供者的模式 By now you have probably noticed that your application already has many service providers registered in the ``app`` configuration file. Each of these service providers bootstraps a part of the framework core. For example, the ``MigrationServiceProvider`` bootstraps the various classes that run migrations, as well as the migration Artisan commands. The ``EventServiceProvider`` bootstraps and registers the event dispatcher class. Some of these providers are larger than others, but they each bootstrap a piece of the core. > Meet Your Providers > > One of the best way to improve your understanding of the Laravel core is to read the source for the core service providers. If you are familiar with the function of service providers and what each core service provider registers, you will have an incredibly better understanding of how Laravel works under the hood. > Most of the core providers are deferred, meaning they do not load on every request; however, some, such as the ``FilesystemServiceProvider`` and ``ExceptionServiceProvider`` load on every request to your application since they bootstrap very foundational piece of the framework. One might say that the core service providers and the application container are Laravel. They are what ties all of the various pieces of the framework together into a single, cohesive unit. These providers are the building blocks of the framework. As mentioned previously, if you wish to gain a deeper understanding of how the framework works, read the source code of the core service providers that ship with Laravel. By reading through these providers, you will gain a solid understanding of how the framework is put together, as well as what each provider offers to your application. Furthermore, you will be better prepared to contribute to Laravel itself!