Illuminate\Routing\UrlGenerator::route PHP Method

route() public method

Get the URL to a named route.
public route ( string $name, mixed $parameters = [], boolean $absolute = true ) : string
$name string
$parameters mixed
$absolute boolean
return string
    public function route($name, $parameters = [], $absolute = true)
    {
        if (!is_null($route = $this->routes->getByName($name))) {
            return $this->toRoute($route, $parameters, $absolute);
        }
        throw new InvalidArgumentException("Route [{$name}] not defined.");
    }

Usage Example

Beispiel #1
1
 /**
  * @param View $view
  */
 public function compose(View $view)
 {
     $view->cruddyData = $this->cruddy->data();
     $view->cruddyData += ['schemaUrl' => $this->url->route('cruddy.schema'), 'thumbUrl' => $this->url->route('cruddy.thumb'), 'baseUrl' => $this->url->route('cruddy.home'), 'root' => $this->request->root(), 'token' => csrf_token()];
     $view->scripts = $this->assets->scripts();
     $view->styles = $this->assets->styles();
     $view->menu = $this->menuBuilder;
 }
All Usage Examples Of Illuminate\Routing\UrlGenerator::route