LaravelURL

Summary

No protected properties found
N/A
No private methods found
No private properties found
N/A
File
url.php
Package
Default
Class hierarchy
LaravelURL

Tags

None found

Properties

$base

$base : string

The cached base URL.

Type

string

Tags

None found

Methods

full()

full() : string

Get the full URI including the query string.

Returns

string

static

Tags

None found

current()

current() : string

Get the full URL for the current request.

Returns

string

static

Tags

None found

home()

home(boolean  $https = null) : string

Get the URL for the application root.

Parameters

boolean $https

Returns

string

static

Tags

None found

base()

base() : string

Get the base URL of the application.

Returns

string

static

Tags

None found

to()

to(string  $url = '', boolean  $https = null, boolean  $asset = false, boolean  $locale = true) : string

Generate an application URL.

// Create a URL to a location within the application $url = URL::to('user/profile');

// Create a HTTPS URL to a location within the application
$url = URL::to('user/profile', true);

Parameters

string $url
boolean $https
boolean $asset
boolean $locale

Returns

string

static

Tags

None found

to_secure()

to_secure(string  $url = '') : string

Generate an application URL with HTTPS.

Parameters

string $url

Returns

string

static

Tags

None found

to_action()

to_action(string  $action, array  $parameters = array()) : string

Generate a URL to a controller action.

// Generate a URL to the "index" method of the "user" controller $url = URL::to_action('user@index');

// Generate a URL to http://example.com/user/profile/taylor
$url = URL::to_action('user@profile', array('taylor'));

Parameters

string $action
array $parameters

Returns

string

static

Tags

None found

to_asset()

to_asset(string  $url, boolean  $https = null) : string

Generate an application URL to an asset.

Parameters

string $url
boolean $https

Returns

string

static

Tags

None found

to_route()

to_route(string  $name, array  $parameters = array()) : string

Generate a URL from a route name.

// Create a URL to the "profile" named route $url = URL::to_route('profile');

// Create a URL to the "profile" named route with wildcard parameters
$url = URL::to_route('profile', array($username));

Parameters

string $name
array $parameters

Returns

string

static

Tags

None found

to_language()

to_language(string  $language, boolean  $reset = false) : string

Get the URL to switch language, keeping the current page or not

Parameters

string $language

The new language

boolean $reset

Whether navigation should be reset

Returns

string —

An URL

static

Tags

None found

transpose()

transpose(string  $uri, array  $parameters) : string

Substitute the parameters in a given URI.

Parameters

string $uri
array $parameters

Returns

string

static

Tags

None found

valid()

valid(string  $url) : boolean

Determine if the given URL is valid.

Parameters

string $url

Returns

boolean

static

Tags

None found

explicit()

explicit(array  $route, string  $action, array  $parameters) : string

Generate an action URL from a route definition

Parameters

array $route
string $action
array $parameters

Returns

string

static

Tags

None found

convention()

convention(string  $action, array  $parameters) : string

Generate an action URI by convention.

Parameters

string $action
array $parameters

Returns

string

static

Tags

None found