Exemplo n.º 1
0
 /**
  * Return the actual type.
  * People could have passed in a simple classname.
  *
  *
  * @param $type
  * @return array|mixed
  * @throws Exception
  */
 protected function getSearchable($type)
 {
     if (is_string($type)) {
         $classname = $this->config->getClass($type);
         $with = $this->config->getWith($type);
         $type = $this->container->make($classname);
         return [$type, array_keys($with)];
     }
     if (!is_object($type) || !$type instanceof Searchable) {
         throw new Exception('Invalid searchable provided, expecting something Modules\\Search\\Searchable');
     }
     return $type;
 }