Skip to content

Commit 3060f23

Browse files
committed
5.5.4
1 parent 0436de9 commit 3060f23

14 files changed

+88
-67
lines changed

bun.lockb

5.95 KB
Binary file not shown.

composer.json

+4-2
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,20 @@
2828
"symfony/deprecation-contracts": "^2.5|^3.0",
2929
"symfony/finder": "^6.4.13|^7.0.3",
3030
"symfony/polyfill-intl-icu": "^1.31",
31+
"symfony/polyfill-php82": "^1.31",
3132
"symfony/polyfill-php83": "^1.31",
3233
"symfony/polyfill-php84": "^1.31",
3334
"symfony/process": "^6.4.14|^7.0.3"
3435
},
3536
"require-dev": {
3637
"doctrine/dbal": "^3.5.1|^4.0",
3738
"larastan/larastan": "^2.9.14|^3.1",
39+
"laravel/nova-devtool": "^1.8",
3840
"laravel/pint": "^1.20",
3941
"laravel/scout": "^10.12.2",
4042
"orchestra/testbench-core": "^8.35|^9.12|^10.1",
4143
"orchestra/testbench-dusk": "^8.36|^9.15|^10.1",
42-
"orchestra/workbench": "^8.17.3|^9.13.3|^10.0.1",
44+
"orchestra/workbench": "^8.17.4|^9.13.4|^10.0.3",
4345
"phpstan/phpstan": "^1.12.20|^2.1.7",
4446
"phpunit/phpunit": "^10.5.35|^11.3.5",
4547
"predis/predis": "^2.3",
@@ -170,5 +172,5 @@
170172
},
171173
"minimum-stability": "dev",
172174
"prefer-stable": true,
173-
"version": "5.5.3"
175+
"version": "5.5.4"
174176
}

package-lock.json

+15-15
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+6-6
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212
"test": "./node_modules/.bin/jest"
1313
},
1414
"devDependencies": {
15-
"@babel/preset-env": "^7.26.7",
15+
"@babel/preset-env": "^7.26.9",
1616
"@tailwindcss/container-queries": "^0.1.1",
1717
"@tailwindcss/typography": "^0.5.16",
18-
"@types/lodash": "^4.17.15",
19-
"@vue/babel-plugin-jsx": "^1.2.5",
18+
"@types/lodash": "^4.17.16",
19+
"@vue/babel-plugin-jsx": "^1.4.0",
2020
"@vue/babel-preset-jsx": "^1.4.0",
2121
"@vue/compiler-sfc": "^3.5.13",
2222
"@vue/test-utils": "^2.4.6",
@@ -29,7 +29,7 @@
2929
"cross-env": "^7.0.3",
3030
"jest": "^27.5.1",
3131
"laravel-mix": "^6.0.49",
32-
"postcss": "^8.5.1",
32+
"postcss": "^8.5.3",
3333
"postcss-import": "^14.1.0",
3434
"postcss-rtlcss": "^3.7.2",
3535
"tailwindcss": "^3.4.17",
@@ -47,7 +47,7 @@
4747
"@vueuse/core": "^10.11.1",
4848
"@vueuse/integrations": "^10.11.1",
4949
"autosize": "^4.0.4",
50-
"axios": "^1.8.1",
50+
"axios": "^1.8.4",
5151
"chartist": "^1.3.1",
5252
"chartist-plugin-tooltips-updated": "^1.0.0",
5353
"codemirror": "^5.65.19",
@@ -56,7 +56,7 @@
5656
"focus-trap": "^7.6.4",
5757
"inflector-js": "^1.0.1",
5858
"js-cookie": "^2.2.1",
59-
"laravel-echo": "^1.16.1",
59+
"laravel-echo": "^1.19.0",
6060
"laravel-vapor": "^0.7.1",
6161
"lodash": "^4.17.21",
6262
"luxon": "^1.28.1",

public/app.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/mix-manifest.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
2-
"/app.js": "/app.js?id=2ed44de0138d16238ba20f9944de40af",
2+
"/app.js": "/app.js?id=884ec8563d6be8e3fdef3eeaa3868758",
33
"/ui.js": "/ui.js?id=592866a715b1c20b43fff6ca7980b279",
44
"/manifest.js": "/manifest.js?id=3267e5c99fd7b729e2f38ec55b50397d",
55
"/app.css": "/app.css?id=4ac240e9b4c482451bf95d4161751414",
6-
"/vendor.js": "/vendor.js?id=d4575477537b83268fdef08ed2409b9d",
6+
"/vendor.js": "/vendor.js?id=eebeb328ddc112be14198734fc6e7076",
77
"/fonts/snunitosansv11pe01mimslybiv1o4x1m8cce4g1pty10iurt9w6fk2a.woff2": "/fonts/snunitosansv11pe01mimslybiv1o4x1m8cce4g1pty10iurt9w6fk2a.woff2?id=c8390e146be0a3c8a5498355dec892ae",
88
"/fonts/snunitosansv11pe01mimslybiv1o4x1m8cce4g1pty14iurt9w6fk2a.woff2": "/fonts/snunitosansv11pe01mimslybiv1o4x1m8cce4g1pty14iurt9w6fk2a.woff2?id=b0735c7dd6126471acbaf9d6e9f5e41a",
99
"/fonts/snunitosansv11pe01mimslybiv1o4x1m8cce4g1pty1ciurt9w6fk2a.woff2": "/fonts/snunitosansv11pe01mimslybiv1o4x1m8cce4g1pty1ciurt9w6fk2a.woff2?id=7c1fb232e3050e36dcc1aee61f1d0c06",

public/vendor.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/vendor.js.LICENSE.txt

+2
Original file line numberDiff line numberDiff line change
@@ -485,6 +485,8 @@
485485

486486
/*! @license DOMPurify 3.2.3 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.3/LICENSE */
487487

488+
/*! Axios v1.8.4 Copyright (c) 2025 Matt Zabriskie and contributors */
489+
488490
/*! Hammer.JS - v2.0.7 - 2016-04-22
489491
* http://hammerjs.github.io/
490492
*

src/Auth/Actions/ResetUserPassword.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,10 @@ class ResetUserPassword implements ResetsUserPasswords
1818
* @param \Illuminate\Contracts\Auth\CanResetPassword&\Illuminate\Database\Eloquent\Model $user
1919
* @param array<string, string> $input
2020
*/
21-
public function reset(CanResetPassword $user, array $input): void
22-
{
21+
public function reset(
22+
CanResetPassword $user,
23+
#[\SensitiveParameter] array $input
24+
): void {
2325
Validator::make($input, [
2426
'password' => $this->passwordWithConfirmedRules(),
2527
])->validate();

src/Auth/Actions/UpdateUserPassword.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,10 @@ class UpdateUserPassword implements UpdatesUserPasswords
1919
* @param \Illuminate\Contracts\Auth\Authenticatable&\Illuminate\Database\Eloquent\Model $user
2020
* @param array<string, string> $input
2121
*/
22-
public function update(Authenticatable $user, array $input): void
23-
{
22+
public function update(
23+
Authenticatable $user,
24+
#[\SensitiveParameter] array $input
25+
): void {
2426
$userGuard = Util::userGuard();
2527

2628
Validator::make($input, [

src/Nova.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -799,7 +799,7 @@ class_exists($value, false) => class_basename($value),
799799
return $value->label();
800800
}
801801

802-
return Str::headline($value->name);
802+
return Str::title(str_replace('_', ' ', $value->name));
803803
}
804804

805805
/**

src/Tabs/Tab.php

+20-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
namespace Laravel\Nova\Tabs;
44

5+
use Illuminate\Http\Resources\ConditionallyLoadsAttributes;
6+
use Illuminate\Http\Resources\MissingValue;
7+
use Illuminate\Support\Collection;
58
use Illuminate\Support\Str;
69
use JsonSerializable;
710
use Laravel\Nova\Makeable;
@@ -12,6 +15,7 @@
1215
*/
1316
class Tab implements JsonSerializable
1417
{
18+
use ConditionallyLoadsAttributes;
1519
use Makeable;
1620

1721
/**
@@ -24,6 +28,13 @@ class Tab implements JsonSerializable
2428
*/
2529
public string $attribute;
2630

31+
/**
32+
* List of fields available for the tab.
33+
*
34+
* @var array<int, \Laravel\Nova\Fields\Field>
35+
*/
36+
public array $fields = [];
37+
2738
/**
2839
* The position of the tab.
2940
*/
@@ -33,15 +44,22 @@ class Tab implements JsonSerializable
3344
* Construct a new tab instance.
3445
*
3546
* @param \Stringable|string $name
36-
* @param array<int, \Laravel\Nova\Fields\Field> $fields
47+
* @param (callable():(iterable))|iterable $fields
3748
*/
3849
public function __construct(
3950
$name,
40-
public array $fields,
51+
callable|iterable $fields,
4152
?string $attribute = null,
4253
) {
4354
$this->name = $name;
4455
$this->attribute = $attribute ?? Str::slug($name);
56+
57+
$fields = \is_callable($fields) ? \call_user_func($fields) : $fields;
58+
59+
$this->fields = collect($this->filter($fields instanceof Collection ? $fields->all() : $fields))
60+
->reject(static fn ($field) => $field instanceof MissingValue)
61+
->values()
62+
->all();
4563
}
4664

4765
/**

src/Util.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public static function isNovaRequest(Request $request): bool
4848
}
4949

5050
/**
51-
* Convert large integer higher than Number.MAX_SAFE_INTEGER to string.
51+
* Convert a large integer higher than Number.MAX_SAFE_INTEGER to string.
5252
*
5353
* https://stackoverflow.com/questions/47188449/json-max-int-number/47188576
5454
*/
@@ -149,7 +149,7 @@ public static function userModel(): ?string
149149
}
150150

151151
/**
152-
* Get the user model for Laravel Nova, use default User model available from Framework as fallback.
152+
* Get the user model for Laravel Nova, use the default User model available from Framework as a fallback.
153153
*
154154
* @return class-string<\Illuminate\Foundation\Auth\User|\Illuminate\Database\Eloquent\Model>
155155
*/
@@ -171,7 +171,7 @@ public static function userModelFromGuard(string $guard): ?string
171171
}
172172

173173
/**
174-
* Get the session auth guard for the model.
174+
* Get the session authentication guard for the model.
175175
*
176176
* @param class-string<\Illuminate\Database\Eloquent\Model>|\Illuminate\Database\Eloquent\Model $model
177177
*/
@@ -264,7 +264,7 @@ public static function eol(string $content): string
264264
}
265265

266266
/**
267-
* Expect given model to implements `Pivot` class or uses `AsPivot` trait.
267+
* Expect the given model to implement `Pivot` class or use `AsPivot` trait.
268268
*
269269
* @param (\Illuminate\Database\Eloquent\Model&\Illuminate\Database\Eloquent\Relations\Concerns\AsPivot)|\Illuminate\Database\Eloquent\Relations\Pivot $pivot
270270
* @return (\Illuminate\Database\Eloquent\Model&\Illuminate\Database\Eloquent\Relations\Concerns\AsPivot)|\Illuminate\Database\Eloquent\Relations\Pivot

src/WithBadge.php

+24-29
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,10 @@ trait WithBadge
99
/**
1010
* The badge content for the menu item.
1111
*
12-
* @var (\Closure():(\Laravel\Nova\Badge|string))|(callable():(\Laravel\Nova\Badge|string))|\Laravel\Nova\Badge|string|null
12+
* @var (\Closure():(\Laravel\Nova\Badge|string|false))|(callable():(\Laravel\Nova\Badge|string|false))|\Laravel\Nova\Badge|string|false|null
1313
*/
1414
public $badgeCallback;
1515

16-
/**
17-
* The condition for showing the badge inside the menu item.
18-
*
19-
* @var (\Closure():bool)|bool
20-
*/
21-
public $badgeCondition = true;
22-
2316
/**
2417
* The type of badge that should represent the item.
2518
*
@@ -30,7 +23,7 @@ trait WithBadge
3023
/**
3124
* Set the content to be used for the item's badge.
3225
*
33-
* @param \Laravel\Nova\Badge|(callable():(\Laravel\Nova\Badge|string))|string $badgeCallback
26+
* @param \Laravel\Nova\Badge|(callable():(\Laravel\Nova\Badge|string|false))|string $badgeCallback
3427
* @return $this
3528
*/
3629
public function withBadge(Badge|callable|string $badgeCallback, string $type = 'info')
@@ -51,43 +44,45 @@ public function withBadge(Badge|callable|string $badgeCallback, string $type = '
5144
/**
5245
* Set the content to be used for the item's badge if the condition matches.
5346
*
54-
* @param \Laravel\Nova\Badge|(callable():(\Laravel\Nova\Badge|string))|string $badgeCallback
47+
* @param \Laravel\Nova\Badge|(callable():(\Laravel\Nova\Badge|string|false))|string $badgeCallback
5548
* @param (\Closure():(bool))|bool $condition
5649
* @return $this
5750
*/
5851
public function withBadgeIf(Badge|callable|string $badgeCallback, string $type, Closure|bool $condition)
5952
{
60-
$this->badgeCondition = $condition;
61-
62-
$this->withBadge($badgeCallback, $type);
53+
$this->withBadge(function () use ($badgeCallback, $condition) {
54+
if (value($condition) === true) {
55+
return \is_callable($badgeCallback) ? \call_user_func($badgeCallback) : $badgeCallback;
56+
} else {
57+
return false;
58+
}
59+
}, $type);
6360

6461
return $this;
6562
}
6663

6764
/**
6865
* Resolve the badge for the item.
66+
*
67+
* @throws \Exception
6968
*/
7069
public function resolveBadge(): ?Badge
7170
{
72-
if (value($this->badgeCondition)) {
73-
if (\is_callable($this->badgeCallback)) {
74-
/** @var \Laravel\Nova\Badge|string|null $result */
75-
$result = \call_user_func($this->badgeCallback);
76-
77-
if (\is_null($result)) {
78-
throw new \Exception('A menu item badge must always have a value.');
79-
}
80-
81-
if (! $result instanceof Badge) {
82-
return Badge::make($result, $this->badgeType);
83-
}
71+
if (! \is_callable($this->badgeCallback)) {
72+
return $this->badgeCallback;
73+
}
8474

85-
return $result;
86-
}
75+
/** @var \Laravel\Nova\Badge|string|false|null $result */
76+
$result = \call_user_func($this->badgeCallback);
8777

88-
return $this->badgeCallback;
78+
if (\is_null($result)) {
79+
throw new \Exception('A menu item badge must always have a value.');
8980
}
9081

91-
return null;
82+
return match (true) {
83+
$result === false => null,
84+
! $result instanceof Badge => Badge::make($result, $this->badgeType),
85+
default => $result,
86+
};
9287
}
9388
}

0 commit comments

Comments
 (0)