Ejemplo n.º 1
0
 /**
  * Make a route.
  *
  * @param                    $route
  * @param  array             $parameters
  * @return mixed|null|string
  */
 public function make($route, array $parameters = [])
 {
     if (method_exists($this, $method = $this->str->camel(str_replace('.', '_', $route)))) {
         $parameters['parameters'] = $parameters;
         return $this->container->call([$this, $method], $parameters);
     }
     if (!str_contains($route, '.') && ($stream = $this->entry->getStreamSlug())) {
         $route = "{$stream}.{$route}";
     }
     if (!str_contains($route, '::') && ($namespace = $this->locator->locate($this->entry))) {
         $route = "{$namespace}::{$route}";
     }
     return $this->url->make($route, $this->entry, $parameters);
 }