From 1257df20451ed6a6542b9f25d9deb18c07a0247e Mon Sep 17 00:00:00 2001 From: JonLee Date: Tue, 25 Nov 2025 20:15:10 +0800 Subject: [PATCH 1/2] fix: incorrect GitHub repository address --- resources/views/dashboard/title.blade.php | 2 +- resources/views/partials/footer.blade.php | 2 +- src/Console/stubs/bootstrap.stub | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/resources/views/dashboard/title.blade.php b/resources/views/dashboard/title.blade.php index b52e91f8..4a61d343 100644 --- a/resources/views/dashboard/title.blade.php +++ b/resources/views/dashboard/title.blade.php @@ -29,7 +29,7 @@ Laravel-admin \ No newline at end of file diff --git a/resources/views/partials/footer.blade.php b/resources/views/partials/footer.blade.php index c60553e2..1f3c9c95 100644 --- a/resources/views/partials/footer.blade.php +++ b/resources/views/partials/footer.blade.php @@ -14,5 +14,5 @@ - Powered by laravel-admin + Powered by laravel-admin \ No newline at end of file diff --git a/src/Console/stubs/bootstrap.stub b/src/Console/stubs/bootstrap.stub index 03728d47..7761f4fe 100644 --- a/src/Console/stubs/bootstrap.stub +++ b/src/Console/stubs/bootstrap.stub @@ -2,7 +2,7 @@ /** * Laravel-admin - admin builder based on Laravel. - * @author z-song + * @author leeqvip * * Bootstraper for Admin. * From 67ff342f9afafa3da93203063c4553fe69429db4 Mon Sep 17 00:00:00 2001 From: JonLee Date: Thu, 27 Nov 2025 00:28:18 +0800 Subject: [PATCH 2/2] fix: implicitly nullable parameters are deprecated in php8.4 --- src/Admin.php | 6 +++--- src/Form.php | 6 +++--- src/Form/Builder.php | 2 +- src/Form/Concerns/HasHooks.php | 2 +- src/Form/Field.php | 4 ++-- src/Form/Field/Captcha.php | 2 +- src/Form/Field/HasValuePicker.php | 2 +- src/Form/Field/ImageField.php | 2 +- src/Form/Field/MultipleFile.php | 2 +- src/Form/Field/MultipleImage.php | 2 +- src/Form/Field/ValuePicker.php | 4 ++-- src/Form/NestedForm.php | 4 ++-- src/Grid.php | 8 ++++---- src/Grid/Concerns/HasFooter.php | 2 +- src/Grid/Concerns/HasHeader.php | 2 +- src/Grid/Exporters/AbstractExporter.php | 2 +- src/Grid/Model.php | 4 ++-- src/Grid/Tools/BatchActions.php | 2 +- src/Layout/Content.php | 2 +- src/Show.php | 2 +- src/Traits/ModelTree.php | 4 ++-- src/Tree.php | 2 +- 22 files changed, 34 insertions(+), 34 deletions(-) diff --git a/src/Admin.php b/src/Admin.php index f20795f2..4d82105e 100644 --- a/src/Admin.php +++ b/src/Admin.php @@ -117,7 +117,7 @@ public function form($model, Closure $callable) * * @return \Ladmin\Tree */ - public function tree($model, Closure $callable = null) + public function tree($model, ?Closure $callable = null) { return new Tree($this->getModel($model), $callable); } @@ -144,7 +144,7 @@ public function show($model, $callable = null) * * @deprecated since v1.6.1 */ - public function content(Closure $callable = null) + public function content(?Closure $callable = null) { return new Content($callable); } @@ -275,7 +275,7 @@ public function guard() * * @return Navbar */ - public function navbar(Closure $builder = null) + public function navbar(?Closure $builder = null) { if (is_null($builder)) { return $this->getNavbar(); diff --git a/src/Form.php b/src/Form.php index f9300107..7ed21131 100644 --- a/src/Form.php +++ b/src/Form.php @@ -121,7 +121,7 @@ class Form implements Renderable * @param $model * @param \Closure $callback */ - public function __construct($model, Closure $callback = null) + public function __construct($model, ?Closure $callback = null) { $this->model = $model; @@ -1316,7 +1316,7 @@ public function tools(Closure $callback) * * @return Form\Tools */ - public function header(Closure $callback = null) + public function header(?Closure $callback = null) { if (func_num_args() === 0) { return $this->builder->getTools(); @@ -1426,7 +1426,7 @@ public function disableCreatingCheck(bool $disable = true): self * * @return \Ladmin\Form\Footer */ - public function footer(Closure $callback = null) + public function footer(?Closure $callback = null) { if (func_num_args() === 0) { return $this->builder()->getFooter(); diff --git a/src/Form/Builder.php b/src/Form/Builder.php index 1d55dfb9..b3da276a 100644 --- a/src/Form/Builder.php +++ b/src/Form/Builder.php @@ -230,7 +230,7 @@ public function getResourceId() * * @return string */ - public function getResource(int $slice = null): string + public function getResource(?int $slice = null): string { if ($this->mode === self::MODE_CREATE) { return $this->form->resource(-1); diff --git a/src/Form/Concerns/HasHooks.php b/src/Form/Concerns/HasHooks.php index 1e31debf..104a72d6 100644 --- a/src/Form/Concerns/HasHooks.php +++ b/src/Form/Concerns/HasHooks.php @@ -27,7 +27,7 @@ trait HasHooks * * @param Closure $callback */ - public static function init(Closure $callback = null) + public static function init(?Closure $callback = null) { static::$initCallbacks[] = $callback; } diff --git a/src/Form/Field.php b/src/Form/Field.php index cb48101c..48c71452 100644 --- a/src/Form/Field.php +++ b/src/Form/Field.php @@ -495,7 +495,7 @@ public function setOriginal($data) * * @return $this */ - public function setForm(Form $form = null) + public function setForm(?Form $form = null) { $this->form = $form; @@ -867,7 +867,7 @@ public function value($value = null) * * @return mixed */ - public function data(array $data = null) + public function data(?array $data = null) { if ($data === null) { return $this->data; diff --git a/src/Form/Field/Captcha.php b/src/Form/Field/Captcha.php index 72dcfbf6..7e04c304 100644 --- a/src/Form/Field/Captcha.php +++ b/src/Form/Field/Captcha.php @@ -20,7 +20,7 @@ public function __construct($column, $arguments = []) $this->label = trans('admin.captcha'); } - public function setForm(Form $form = null) + public function setForm(?Form $form = null) { $this->form = $form; diff --git a/src/Form/Field/HasValuePicker.php b/src/Form/Field/HasValuePicker.php index 01855976..f2971704 100644 --- a/src/Form/Field/HasValuePicker.php +++ b/src/Form/Field/HasValuePicker.php @@ -45,7 +45,7 @@ public function pickMany($picker, $column = '', $separator = ';') * * @return $this */ - protected function mountPicker(\Closure $callback = null) + protected function mountPicker(?\Closure $callback = null) { $this->picker && $this->picker->mount($this, $callback); diff --git a/src/Form/Field/ImageField.php b/src/Form/Field/ImageField.php index b797ebe9..cbe21ae4 100644 --- a/src/Form/Field/ImageField.php +++ b/src/Form/Field/ImageField.php @@ -104,7 +104,7 @@ public function render() * * @return $this */ - public function thumbnail($name, int $width = null, int $height = null) + public function thumbnail($name, ?int $width = null, ?int $height = null) { if (func_num_args() == 1 && is_array($name)) { foreach ($name as $key => $size) { diff --git a/src/Form/Field/MultipleFile.php b/src/Form/Field/MultipleFile.php index cc4a5e7e..0bc6b0e0 100644 --- a/src/Form/Field/MultipleFile.php +++ b/src/Form/Field/MultipleFile.php @@ -176,7 +176,7 @@ public function original() * * @return mixed|string */ - protected function prepareForeach(UploadedFile $file = null) + protected function prepareForeach(?UploadedFile $file = null) { $this->name = $this->getStoreName($file); diff --git a/src/Form/Field/MultipleImage.php b/src/Form/Field/MultipleImage.php index aacf5cfe..afcb504d 100644 --- a/src/Form/Field/MultipleImage.php +++ b/src/Form/Field/MultipleImage.php @@ -27,7 +27,7 @@ class MultipleImage extends MultipleFile * * @return mixed|string */ - protected function prepareForeach(UploadedFile $image = null) + protected function prepareForeach(?UploadedFile $image = null) { $this->name = $this->getStoreName($image); diff --git a/src/Form/Field/ValuePicker.php b/src/Form/Field/ValuePicker.php index ca5075dc..cd73d106 100644 --- a/src/Form/Field/ValuePicker.php +++ b/src/Form/Field/ValuePicker.php @@ -72,7 +72,7 @@ protected function getLoadUrl() * @param Field $field * @param \Closure|null $callback */ - public function mount(Field $field, \Closure $callback = null) + public function mount(Field $field, ?\Closure $callback = null) { $this->field = $field; $this->modal = sprintf('picker-modal-%s', $field->getElementClassString()); @@ -94,7 +94,7 @@ public function mount(Field $field, \Closure $callback = null) /** * @param \Closure|null $callback */ - protected function addPickBtn(\Closure $callback = null) + protected function addPickBtn(?\Closure $callback = null) { $text = admin_trans('admin.browse'); diff --git a/src/Form/NestedForm.php b/src/Form/NestedForm.php index 72bfb351..686a6f3b 100644 --- a/src/Form/NestedForm.php +++ b/src/Form/NestedForm.php @@ -166,7 +166,7 @@ public function setKey($key) * * @return $this */ - public function setForm(Form $form = null) + public function setForm(?Form $form = null) { $this->form = $form; @@ -180,7 +180,7 @@ public function setForm(Form $form = null) * * @return $this */ - public function setWidgetForm(WidgetForm $form = null) + public function setWidgetForm(?WidgetForm $form = null) { $this->form = $form; diff --git a/src/Grid.php b/src/Grid.php index 7089da58..f0d75f8d 100644 --- a/src/Grid.php +++ b/src/Grid.php @@ -170,9 +170,9 @@ class Grid * Create a new grid instance. * * @param Eloquent $model - * @param Closure $builder + * @param Closure|null $builder */ - public function __construct(Eloquent $model, Closure $builder = null) + public function __construct(Eloquent $model, ?Closure $builder = null) { $this->model = new Model($model, $this); $this->keyName = $model->getKeyName(); @@ -202,7 +202,7 @@ protected function initialize() * * @param Closure $callback */ - public static function init(Closure $callback = null) + public static function init(?Closure $callback = null) { static::$initCallbacks[] = $callback; } @@ -603,7 +603,7 @@ protected function buildRows(array $data, Collection $collection) * * @return Collection|null */ - public function rows(Closure $callable = null) + public function rows(?Closure $callable = null) { if (is_null($callable)) { return $this->rows; diff --git a/src/Grid/Concerns/HasFooter.php b/src/Grid/Concerns/HasFooter.php index 4f6dbc36..1d223cbe 100644 --- a/src/Grid/Concerns/HasFooter.php +++ b/src/Grid/Concerns/HasFooter.php @@ -19,7 +19,7 @@ trait HasFooter * * @return $this|Closure */ - public function footer(Closure $closure = null) + public function footer(?Closure $closure = null) { if (!$closure) { return $this->footer; diff --git a/src/Grid/Concerns/HasHeader.php b/src/Grid/Concerns/HasHeader.php index 40229a73..15d27483 100644 --- a/src/Grid/Concerns/HasHeader.php +++ b/src/Grid/Concerns/HasHeader.php @@ -19,7 +19,7 @@ trait HasHeader * * @return $this|Closure */ - public function header(Closure $closure = null) + public function header(?Closure $closure = null) { if (!$closure) { return $this->header; diff --git a/src/Grid/Exporters/AbstractExporter.php b/src/Grid/Exporters/AbstractExporter.php index 939b1084..4c1b0c47 100644 --- a/src/Grid/Exporters/AbstractExporter.php +++ b/src/Grid/Exporters/AbstractExporter.php @@ -21,7 +21,7 @@ abstract class AbstractExporter implements ExporterInterface * * @param $grid */ - public function __construct(Grid $grid = null) + public function __construct(?Grid $grid = null) { if ($grid) { $this->setGrid($grid); diff --git a/src/Grid/Model.php b/src/Grid/Model.php index c5ff0643..34592f00 100644 --- a/src/Grid/Model.php +++ b/src/Grid/Model.php @@ -99,7 +99,7 @@ class Model * @param EloquentModel $model * @param Grid $grid */ - public function __construct(EloquentModel $model, Grid $grid = null) + public function __construct(EloquentModel $model, ?Grid $grid = null) { $this->model = $model; @@ -279,7 +279,7 @@ public function getConstraints() * * @return $this */ - public function collection(\Closure $callback = null) + public function collection(?\Closure $callback = null) { $this->collectionCallback = $callback; diff --git a/src/Grid/Tools/BatchActions.php b/src/Grid/Tools/BatchActions.php index 4781205d..0fe6d7a1 100644 --- a/src/Grid/Tools/BatchActions.php +++ b/src/Grid/Tools/BatchActions.php @@ -76,7 +76,7 @@ public function disableDeleteAndHodeSelectAll() * * @return $this */ - public function add($title, BatchAction $action = null) + public function add($title, ?BatchAction $action = null) { $id = $this->actions->count(); diff --git a/src/Layout/Content.php b/src/Layout/Content.php index cdddbb4a..e8a5ccc0 100644 --- a/src/Layout/Content.php +++ b/src/Layout/Content.php @@ -45,7 +45,7 @@ class Content implements Renderable * * @param Closure|null $callback */ - public function __construct(\Closure $callback = null) + public function __construct(?\Closure $callback = null) { if ($callback instanceof Closure) { $callback($this); diff --git a/src/Show.php b/src/Show.php index fc129276..4fdbf98f 100644 --- a/src/Show.php +++ b/src/Show.php @@ -101,7 +101,7 @@ public function __construct($model, $builder = null) * * @param \Closure $callback */ - public static function init(\Closure $callback = null) + public static function init(?\Closure $callback = null) { static::$initCallback = $callback; } diff --git a/src/Traits/ModelTree.php b/src/Traits/ModelTree.php index e53f2467..5ac5672f 100644 --- a/src/Traits/ModelTree.php +++ b/src/Traits/ModelTree.php @@ -120,7 +120,7 @@ public function setOrderColumn($column) * * @return $this */ - public function withQuery(\Closure $query = null) + public function withQuery(?\Closure $query = null) { $this->queryCallback = $query; @@ -236,7 +236,7 @@ public static function saveOrder($tree = [], $parentId = 0) * * @return array */ - public static function selectOptions(\Closure $closure = null, $rootText = 'ROOT') + public static function selectOptions(?\Closure $closure = null, $rootText = 'ROOT') { $options = (new static())->withQuery($closure)->buildSelectOptions(); diff --git a/src/Tree.php b/src/Tree.php index f09b5d18..09e044fe 100644 --- a/src/Tree.php +++ b/src/Tree.php @@ -81,7 +81,7 @@ class Tree implements Renderable * * @param Model|null $model */ - public function __construct(Model $model = null, \Closure $callback = null) + public function __construct(?Model $model = null, ?\Closure $callback = null) { $this->model = $model;