/**
  * Registers any service providers listed in the core config.
  *
  * @return $this
  */
 protected function registerConfiguredServiceProviders()
 {
     $providers = $this->core->apiConfig('providers', []);
     foreach ($providers as $provider) {
         $this->app->register($provider);
     }
     return $this;
 }
 /**
  * Formats an exception as a standardized error response.
  *
  * @param Exception   $e
  * @param null|string $fallbackMessage  message to use if exception has none
  * @return mixed
  */
 protected function formatExceptionError(Exception $e, $fallbackMessage = null)
 {
     if (app()->isLocal() && $this->core->apiConfig('debug.local-exception-trace', true)) {
         return $this->formatExceptionErrorForLocal($e, $fallbackMessage);
     }
     $message = $e->getMessage() ?: $fallbackMessage;
     return ['message' => $message];
 }
 /**
  * @return string
  */
 protected function getLogoutMethod()
 {
     return $this->core->apiConfig('route.auth.method.logout', 'post');
 }
 /**
  * Returns the middleware group that all CMS API routes belongs to.
  *
  * @return string
  */
 protected function getConfiguredApiGroupName()
 {
     return $this->core->apiConfig('middleware.group', 'cms-api');
 }