setBinds(); } public function handle(AfterProcessStatusChangedEvent $event) { if ($this->bound($event->getProcess()->code)) { $this->make($event->getProcess()->code)->handle($event->getProcess()); } } public function setBinds() { // collect(\app\common\modules\shop\ShopConfig::current()->get('status'))->each(function ($item,$key) { // $this->bind($key, function (StatusContainer $container) use ($item) { // return new $item(); // // }); // }); collect(\app\common\modules\shop\ShopConfig::current()->get('shop-foundation.status'))->each(function ($item) { $this->bind($item['key'], function (StatusContainer $container) use ($item) { return new $item['class'](); }); }); } }