Skip to content

Commit f23f709

Browse files
committed
5.6.1
1 parent 54f9417 commit f23f709

File tree

3 files changed

+36
-3
lines changed

3 files changed

+36
-3
lines changed

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"inertiajs/inertia-laravel": "^1.3.2|^2.0",
2323
"laravel/fortify": "^1.25.4",
2424
"nesbot/carbon": "^2.62.1|^3.4",
25-
"orchestra/sidekick": "^1.1.5",
25+
"orchestra/sidekick": "^1.2.0",
2626
"rap2hpoutre/fast-excel": "^5.4",
2727
"spatie/once": "^3.0",
2828
"symfony/console": "^6.4.14|^7.0.3",
@@ -173,5 +173,5 @@
173173
},
174174
"minimum-stability": "dev",
175175
"prefer-stable": true,
176-
"version": "5.6.0"
176+
"version": "5.6.1"
177177
}

src/Fields/FieldMergeValue.php

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
use Illuminate\Http\Resources\MergeValue;
77
use Illuminate\Http\Resources\MissingValue;
88
use Illuminate\Support\Collection;
9+
use InvalidArgumentException;
910

1011
/**
1112
* @phpstan-import-type TFields from \Laravel\Nova\Resource
@@ -16,6 +17,33 @@ abstract class FieldMergeValue extends MergeValue
1617
{
1718
use ConditionallyLoadsAttributes;
1819

20+
/**
21+
* Determine if the given offset exists.
22+
*
23+
* @param string $offset
24+
*/
25+
public function __isset($offset): bool
26+
{
27+
return match ($offset) {
28+
'fields' => true,
29+
default => false,
30+
};
31+
}
32+
33+
/**
34+
* Get the value for a given offset.
35+
*
36+
* @param string $offset
37+
* @return mixed
38+
*/
39+
public function __get($offset): mixed
40+
{
41+
return match ($offset) {
42+
'fields' => $this->data,
43+
default => throw new InvalidArgumentException(sprintf('Unable to retrieve $%s value', $offset)),
44+
};
45+
}
46+
1947
/**
2048
* Prepare the given fields.
2149
*

src/Http/Middleware/RedirectIfAuthenticated.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use Closure;
66
use Illuminate\Support\Facades\Auth;
77
use Laravel\Nova\Nova;
8+
use Laravel\Nova\Util;
89

910
class RedirectIfAuthenticated
1011
{
@@ -18,7 +19,11 @@ class RedirectIfAuthenticated
1819
*/
1920
public function handle($request, Closure $next, $guard = null)
2021
{
21-
if (Auth::guard($guard)->check()) {
22+
if (! \is_null($guard)) {
23+
trigger_deprecation('laravel/nova', '5.6.1', 'Guard parameter no longer supported via [%s] middleware', __CLASS__);
24+
}
25+
26+
if (Auth::guard(Util::userGuard())->check()) {
2227
return redirect(Nova::path());
2328
}
2429

0 commit comments

Comments
 (0)