/** * Calls each of the repository binding methods * * @return void * * @throws \RuntimeException If the repository binding method does not * define an interface to bind the concrete repository instance to */ protected function callRepositoryBindingMethods() { $classMethods = get_class_methods($this); foreach ($classMethods as $methodName) { $method = DynamicMethod::parse($methodName); if ($method->startsWith('bind') && $method->endsWith('Repository')) { $this->registerRepository($method->invokeOn($this)); } } }
/** * Calls each of the view binding methods * * @return void */ protected function callViewBindingMethods() { $classMethods = get_class_methods($this); foreach ($classMethods as $methodName) { $method = DynamicMethod::parse($methodName); if ($method->first() === 'bind' && $method->last() === 'Views') { $this->viewBinder->setNamespace('')->setPrefix(''); $method->invokeOn($this); } } }