diff --git a/src/Http/Controllers/Admin/AppSettingsController.php b/src/Http/Controllers/Admin/AppSettingsController.php index 6e4689331..18d104063 100644 --- a/src/Http/Controllers/Admin/AppSettingsController.php +++ b/src/Http/Controllers/Admin/AppSettingsController.php @@ -33,7 +33,7 @@ protected function setUpController(): void } } - public function update(int|string|TwillModelContract $id, ?int $submoduleId = null): JsonResponse + public function update(int|string|TwillModelContract $id, int|string|null $submoduleId = null): JsonResponse { $model = AppSetting::findOrFail($id); diff --git a/src/Http/Controllers/Admin/FileLibraryController.php b/src/Http/Controllers/Admin/FileLibraryController.php index e04eeb40e..a315a00fb 100644 --- a/src/Http/Controllers/Admin/FileLibraryController.php +++ b/src/Http/Controllers/Admin/FileLibraryController.php @@ -106,7 +106,7 @@ public function filters(): TableFilters ]); } - public function index(?int $parentModuleId = null): mixed + public function index(int|string|null $parentModuleId = null): mixed { if ($this->request->has('except')) { $prependScope['exceptIds'] = $this->request->get('except'); @@ -172,7 +172,7 @@ protected function getRequestFilters(): array } /** - * @param int|null $parentModuleId + * @param int|string|null $parentModuleId * @return JsonResponse * @throws BindingResolutionException */ diff --git a/src/Http/Controllers/Admin/GroupController.php b/src/Http/Controllers/Admin/GroupController.php index f9ecdd0b9..503225500 100644 --- a/src/Http/Controllers/Admin/GroupController.php +++ b/src/Http/Controllers/Admin/GroupController.php @@ -100,7 +100,7 @@ public function edit(int|string|TwillModelContract $id): mixed return parent::edit($id); } - public function update(int|string|TwillModelContract $id, ?int $submoduleId = null): JsonResponse + public function update(int|string|TwillModelContract $id, int|string|null $submoduleId = null): JsonResponse { $this->authorizableOptions['edit'] = 'edit-group'; diff --git a/src/Http/Controllers/Admin/MediaLibraryController.php b/src/Http/Controllers/Admin/MediaLibraryController.php index 84c1ae2e2..e0bc6933a 100644 --- a/src/Http/Controllers/Admin/MediaLibraryController.php +++ b/src/Http/Controllers/Admin/MediaLibraryController.php @@ -106,7 +106,7 @@ public function filters(): TableFilters ]); } - public function index(?int $parentModuleId = null): array + public function index(int|string|null $parentModuleId = null): array { if ($this->request->has('except')) { $prependScope['exceptIds'] = $this->request->get('except'); @@ -150,7 +150,7 @@ protected function getRequestFilters(): array } /** - * @param int|null $parentModuleId + * @param int|string|null $parentModuleId * @return */ public function store($parentModuleId = null) diff --git a/src/Http/Controllers/Admin/ModuleController.php b/src/Http/Controllers/Admin/ModuleController.php index fdd1c5e87..43851c804 100644 --- a/src/Http/Controllers/Admin/ModuleController.php +++ b/src/Http/Controllers/Admin/ModuleController.php @@ -259,7 +259,7 @@ abstract class ModuleController extends Controller protected $submodule = false; /** - * @var int|null + * @var int|string|null */ protected $submoduleParentId = null; @@ -970,7 +970,7 @@ protected function getParentModuleIdFromRequest(Request $request) /** * @return IlluminateView|JsonResponse */ - public function index(?int $parentModuleId = null): mixed + public function index(int|string|null $parentModuleId = null): mixed { $this->authorizeOption('list', $this->moduleName); @@ -1032,7 +1032,7 @@ public function browser(): JsonResponse } /** - * @param int|null $parentModuleId + * @param int|string|null $parentModuleId * @return \Illuminate\Http\JsonResponse */ public function store($parentModuleId = null) @@ -1093,7 +1093,7 @@ public function store($parentModuleId = null) /** * @param Request $request * @param int|string $id - * @param int|null $submoduleId + * @param int|string|null $submoduleId * @return \Illuminate\Http\RedirectResponse */ public function show($id, $submoduleId = null) @@ -1169,7 +1169,7 @@ public function edit(TwillModelContract|int|string $id): mixed ); } - public function create(int $parentModuleId = null): JsonResponse|RedirectResponse|IlluminateView + public function create(int|string $parentModuleId = null): JsonResponse|RedirectResponse|IlluminateView { if (! $this->getIndexOption('skipCreateModal')) { return Redirect::to( @@ -1205,7 +1205,7 @@ public function create(int $parentModuleId = null): JsonResponse|RedirectRespons ); } - public function update(int|string|TwillModelContract $id, ?int $submoduleId = null): JsonResponse + public function update(int|string|TwillModelContract $id, int|string|null $submoduleId = null): JsonResponse { [$item, $id] = $this->itemAndIdFromRequest($id); @@ -1435,7 +1435,7 @@ public function bulkPublish(): JsonResponse ); } - public function duplicate(int|string|TwillModelContract $id, ?int $submoduleId = null): JsonResponse + public function duplicate(int|string|TwillModelContract $id, int|string|null $submoduleId = null): JsonResponse { [$item, $id] = $this->itemAndIdFromRequest($id); @@ -1475,7 +1475,7 @@ public function duplicate(int|string|TwillModelContract $id, ?int $submoduleId = ); } - public function destroy(int|string|TwillModelContract $id, ?int $submoduleId = null): JsonResponse + public function destroy(int|string|TwillModelContract $id, int|string|null $submoduleId = null): JsonResponse { [$item, $id] = $this->itemAndIdFromRequest($id); diff --git a/src/Http/Controllers/Admin/RoleController.php b/src/Http/Controllers/Admin/RoleController.php index 70d0f125b..9bd54c71e 100644 --- a/src/Http/Controllers/Admin/RoleController.php +++ b/src/Http/Controllers/Admin/RoleController.php @@ -87,7 +87,7 @@ protected function indexItemData($item): array return ['edit' => $canEdit ? $this->getModuleRoute($item->id, 'edit') : null]; } - public function index(?int $parentModuleId = null): mixed + public function index(int|string|null $parentModuleId = null): mixed { // Superadmins can reorder groups to determine the access-level of each one. // A given group can't edit other groups with a higher access-level. @@ -103,7 +103,7 @@ public function edit(int|string|TwillModelContract $id): mixed return parent::edit($id); } - public function update(int|string|TwillModelContract $id, ?int $submoduleId = null): JsonResponse + public function update(int|string|TwillModelContract $id, int|string|null $submoduleId = null): JsonResponse { $this->authorizableOptions['edit'] = 'edit-role'; diff --git a/src/Http/Controllers/Admin/SingletonModuleController.php b/src/Http/Controllers/Admin/SingletonModuleController.php index d00403ce5..b47dd451c 100644 --- a/src/Http/Controllers/Admin/SingletonModuleController.php +++ b/src/Http/Controllers/Admin/SingletonModuleController.php @@ -11,7 +11,7 @@ abstract class SingletonModuleController extends ModuleController { protected $permalinkBase = ''; - public function index(?int $parentModuleId = null): mixed + public function index(int|string|null $parentModuleId = null): mixed { throw new \Exception("{$this->getModelName()} has no index"); } diff --git a/src/Http/Controllers/Admin/UserController.php b/src/Http/Controllers/Admin/UserController.php index fb8cc58ec..1f2c0e273 100755 --- a/src/Http/Controllers/Admin/UserController.php +++ b/src/Http/Controllers/Admin/UserController.php @@ -296,7 +296,7 @@ public function edit(int|string|TwillModelContract $id): mixed return parent::edit($id); } - public function update(int|string|TwillModelContract $id, ?int $submoduleId = null): JsonResponse + public function update(int|string|TwillModelContract $id, int|string|null $submoduleId = null): JsonResponse { $this->authorizableOptions['edit'] = 'edit-user';