getLocalizedURL() public method

Returns an URL adapted to $locale
public getLocalizedURL ( string | boolean $locale = null, string | false $url = null, array $attributes = [] ) : string | false
$locale string | boolean Locale to adapt, false to remove locale
$url string | false URL to adapt in the current language. If not passed, the current url would be taken.
$attributes array Attributes to add to the route, if empty, the system would try to extract them from the url.
return string | false URL translated, False if url does not exist
Example #1
0
 /**
  * Returns an URL adapted to $locale
  *
  * @throws SupportedLocalesNotDefined
  * @throws UnsupportedLocaleException
  * @param string|boolean $locale Locale to adapt, false to remove locale
  * @param string|false $url URL to adapt in the current language. If not passed, the current url would be taken.
  * @param array $attributes Attributes to add to the route, if empty, the system would try to extract them from the url.
  * @return string|false URL translated, False if url does not exist
  * @static 
  */
 public static function getLocalizedURL($locale = null, $url = null, $attributes = array())
 {
     return \Mcamara\LaravelLocalization\LaravelLocalization::getLocalizedURL($locale, $url, $attributes);
 }