From 4f96f429b22b1b09de6a263bd7d50eda18075b52 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Wed, 23 Nov 2016 09:32:13 -0600 Subject: [PATCH] Get the current path formatter. --- src/Illuminate/Routing/UrlGenerator.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/Illuminate/Routing/UrlGenerator.php b/src/Illuminate/Routing/UrlGenerator.php index 127c9625cc32..51bca1ba5f0e 100755 --- a/src/Illuminate/Routing/UrlGenerator.php +++ b/src/Illuminate/Routing/UrlGenerator.php @@ -719,6 +719,16 @@ public function formatPathUsing(Closure $callback) return $this; } + /** + * Get the path formatter being used by the URL generator. + * + * @return \Closure + */ + public function pathFormatter() + { + return $this->formatPathUsing ?: function ($path) { return $path; }; + } + /** * Get the request instance. *