/** * Register services */ protected function registerServices() { // PodioService $this->app->bind(PodioService::class, function (Application $app) { /** @var array $config */ $config = config('podio'); if (!$config) { ConfigurationException::message('Please provide a podio configuration'); } return new PodioService($config); }); }
/** * Get application from name * * @param string $appName * @return null * @throws ConfigurationException */ public function getApp($appName) { /** @var array $apps */ $apps = $this->options->get('apps'); if (!is_array($apps)) { ConfigurationException::message('Please provide configuration for your podio application'); } $matchedApp = null; foreach ($apps as $app) { if (!isset($app['name']) || $app['name'] != $appName) { continue; } $matchedApp = $app; } if (!$matchedApp) { ConfigurationException::missingApp($appName); } return $matchedApp; }