Illuminate\Routing\UrlGenerator::current PHP Method

current() public method

Get the current URL for the request.
public current ( ) : string
return string
    public function current()
    {
        return $this->to($this->request->getPathInfo());
    }

Usage Example

Beispiel #1
1
 /**
  * Generates a url for Sorter
  *
  * @param string $field
  * @param null|string $path
  * @param boolean $appends
  * */
 public function url($field, $path = null, $appends = true)
 {
     if ($path === null) {
         $path = $this->url->current();
     }
     $queryString = [$this->getFieldIndex() => $field, $this->getDirectionIndex() => $this->getConditionallyDirection($field)];
     $appends && ($queryString += $this->request->query());
     $url = $path . '?' . http_build_query($queryString);
     return $this->url->to($url);
 }
All Usage Examples Of Illuminate\Routing\UrlGenerator::current