Skip to content

Commit 5ae5327

Browse files
authored
Merge pull request #117 from hailwood/patch-1
Add default return to getShared function
2 parents 097fe5b + 9667dca commit 5ae5327

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/Inertia.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
/**
88
* @method static void setRootView($name)
99
* @method static void share($key, $value = null)
10-
* @method static array getShared($key = null)
10+
* @method static array getShared($key = null, $default = null)
1111
* @method static void version($version)
1212
* @method static int|string getVersion()
1313
* @method static Response render($component, $props = [])

src/ResponseFactory.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ public function share($key, $value = null)
3131
}
3232
}
3333

34-
public function getShared($key = null)
34+
public function getShared($key = null, $default = null)
3535
{
3636
if ($key) {
37-
return Arr::get($this->sharedProps, $key);
37+
return Arr::get($this->sharedProps, $key, $default);
3838
}
3939

4040
return $this->sharedProps;

0 commit comments

Comments
 (0)