Thursday, January 25, 2018

different between 'register' and 'boot' on laravel serviceprovider

register: singleton (wihich means bind a class to current container or registering to service provider) a class to container or framework

boot or call it bootstrap which is running service provider (such as App::make('name')).

in the order running, run register at the first and then runs boot.


  1. register是向容器中注册东西
  2. boot用于启动相应的服务(例如事件监听等

No comments: