Created
August 22, 2014 01:11
-
-
Save anaxamaxan/8df15263e9f25cda9872 to your computer and use it in GitHub Desktop.
Allow curly braces in Laravel URL::route() parameters array
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php namespace Cego\Facades; | |
class URL extends \Illuminate\Support\Facades\URL | |
{ | |
public static function route($name, $parameters = array(), $absolute = true, $route = null) | |
{ | |
$urlGenerator = static::$app['url']; | |
/* @var \Illuminate\Routing\UrlGenerator $urlGenerator */ | |
$route = $urlGenerator->route($name, $parameters, $absolute, $route); | |
//untranslate the { and } characters. | |
return str_replace(['%7B','%7D'],['{','}'],$route); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is absolutely needed in core.