summaryrefslogtreecommitdiff
path: root/src/helpers.php
diff options
context:
space:
mode:
authorIgor Scheller <igor.scheller@igorshp.de>2017-09-20 01:09:11 +0200
committerIgor Scheller <igor.scheller@igorshp.de>2017-09-20 01:10:14 +0200
commit86c0713baa2f616bf1dff6d9dbe0ea68b1c00e91 (patch)
tree9f1c0a43c6c02b333059e2e5b30334f7465ab5d6 /src/helpers.php
parentc8d32d23e195d53d6d10fdac5003718b10ffbeaa (diff)
Added helpers unit test
Diffstat (limited to 'src/helpers.php')
-rw-r--r--src/helpers.php14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/helpers.php b/src/helpers.php
index b942068f..de303963 100644
--- a/src/helpers.php
+++ b/src/helpers.php
@@ -69,7 +69,7 @@ function request($key = null, $default = null)
*/
function session($key = null, $default = null)
{
- $session = request()->getSession();
+ $session = app('session');
if (is_null($key)) {
return $session;
@@ -97,9 +97,15 @@ function view($template = null, $data = null)
/**
* @param string $path
* @param array $parameters
- * @return string
+ * @return UrlGenerator|string
*/
-function url($path, $parameters = [])
+function url($path = null, $parameters = [])
{
- return UrlGenerator::to($path, $parameters);
+ $urlGenerator = app('routing.urlGenerator');
+
+ if (is_null($path)) {
+ return $urlGenerator;
+ }
+
+ return $urlGenerator->to($path, $parameters);
}