diff --git a/app/Fileshare/Actions/FileshareApiIndexAction.php b/app/Fileshare/Actions/FileshareApiIndexAction.php
deleted file mode 100644
index 4ee530e1..00000000
--- a/app/Fileshare/Actions/FileshareApiIndexAction.php
+++ /dev/null
@@ -1,21 +0,0 @@
-put('menu', 'setting');
- session()->put('title', 'Datei-Verbindungen');
-
- return FileshareResource::collection(Fileshare::paginate(15));
- }
-}
diff --git a/app/Fileshare/FileshareSettings.php b/app/Fileshare/FileshareSettings.php
index 8cc634b6..97ff21b6 100644
--- a/app/Fileshare/FileshareSettings.php
+++ b/app/Fileshare/FileshareSettings.php
@@ -21,10 +21,8 @@ class FileshareSettings extends LocalSettings
/**
* @inheritdoc
*/
- public function viewData(): array
+ public function data()
{
- return [
- 'data' => FileshareResource::collection(Fileshare::paginate(15))
- ];
+ return FileshareResource::collection(Fileshare::paginate(15));
}
}
diff --git a/app/Http/Resources/UserResource.php b/app/Http/Resources/UserResource.php
index 898441d9..41df3e8c 100644
--- a/app/Http/Resources/UserResource.php
+++ b/app/Http/Resources/UserResource.php
@@ -38,6 +38,10 @@ class UserResource extends JsonResource
public static function meta(): array
{
return [
+ 'default' => [
+ 'firstname' => '',
+ 'lastname' => '',
+ ],
'links' => []
];
}
diff --git a/app/Mailgateway/MailgatewaySettings.php b/app/Mailgateway/MailgatewaySettings.php
index 5e959d66..2cff7c1b 100644
--- a/app/Mailgateway/MailgatewaySettings.php
+++ b/app/Mailgateway/MailgatewaySettings.php
@@ -18,14 +18,6 @@ class MailgatewaySettings extends LocalSettings
return 'E-Mail-Verbindungen';
}
- /**
- * @inheritdoc
- */
- public function meta(): array
- {
- return MailgatewayResource::meta();
- }
-
/**
* @inheritdoc
*/
diff --git a/app/Module/ModuleSettings.php b/app/Module/ModuleSettings.php
index 0ee41cc5..4494a0e3 100644
--- a/app/Module/ModuleSettings.php
+++ b/app/Module/ModuleSettings.php
@@ -41,11 +41,14 @@ class ModuleSettings extends LocalSettings implements Storeable
/**
* @inheritdoc
*/
- public function meta(): array
+ public function data(): array
{
return [
- ...parent::meta(),
- 'modules' => Module::forSelect()
+ ...parent::data(),
+ 'meta' => [
+ ...parent::data()['meta'],
+ 'modules' => Module::forSelect(),
+ ]
];
}
}
diff --git a/app/Setting/Actions/ViewAction.php b/app/Setting/Actions/ViewAction.php
index a1c7a5e1..41eb46de 100644
--- a/app/Setting/Actions/ViewAction.php
+++ b/app/Setting/Actions/ViewAction.php
@@ -20,7 +20,6 @@ class ViewAction
return Inertia::render('setting/' . ucfirst($settingGroup::group()), [
'data' => $settingGroup->data(),
'settingMenu' => app(SettingFactory::class)->getShare(),
- 'meta' => $settingGroup->meta(),
]);
}
}
diff --git a/app/Setting/LocalSettings.php b/app/Setting/LocalSettings.php
index 3bb9e232..f7ecd8d9 100644
--- a/app/Setting/LocalSettings.php
+++ b/app/Setting/LocalSettings.php
@@ -19,21 +19,19 @@ abstract class LocalSettings extends Settings
return $this->url();
}
- public function meta(): array
- {
- return [
- 'links' => [
- 'store' => $this->storeUrl(),
- ]
- ];
- }
-
/**
* @return mixed
*/
public function data()
{
- return $this->toArray();
+ return [
+ 'data' => $this->toArray(),
+ 'meta' => [
+ 'links' => [
+ 'store' => $this->storeUrl(),
+ ]
+ ]
+ ];
}
public function beforeSave(ActionRequest $request): void
diff --git a/app/Setting/NamiSettings.php b/app/Setting/NamiSettings.php
index e64cf032..91298a36 100644
--- a/app/Setting/NamiSettings.php
+++ b/app/Setting/NamiSettings.php
@@ -66,9 +66,12 @@ class NamiSettings extends LocalSettings implements Storeable
public function data(): array
{
return [
- 'mglnr' => $this->mglnr,
- 'password' => '',
- 'default_group_id' => $this->default_group_id,
+ ...parent::data(),
+ 'data' => [
+ 'mglnr' => $this->mglnr,
+ 'password' => '',
+ 'default_group_id' => $this->default_group_id,
+ ],
];
}
}
diff --git a/app/User/Actions/IndexAction.php b/app/User/Actions/IndexAction.php
deleted file mode 100644
index d6461057..00000000
--- a/app/User/Actions/IndexAction.php
+++ /dev/null
@@ -1,18 +0,0 @@
-get());
- }
-}
diff --git a/app/User/UserSettings.php b/app/User/UserSettings.php
index 1bea49f5..b69dbd15 100644
--- a/app/User/UserSettings.php
+++ b/app/User/UserSettings.php
@@ -18,19 +18,11 @@ class UserSettings extends LocalSettings
return 'Benutzer';
}
- /**
- * @inheritdoc
- */
- public function meta(): array
- {
- return UserResource::meta();
- }
-
/**
* @inheritdoc
*/
public function data()
{
- return UserResource::collection(User::orderByRaw('lastname, firstname')->get())->toArray(request());
+ return UserResource::collection(User::orderByRaw('lastname, firstname')->get());
}
}
diff --git a/resources/js/views/setting/Fileshare.vue b/resources/js/views/setting/Fileshare.vue
index 89340fd4..39757ba3 100644
--- a/resources/js/views/setting/Fileshare.vue
+++ b/resources/js/views/setting/Fileshare.vue
@@ -76,10 +76,12 @@
diff --git a/resources/js/views/setting/User.vue b/resources/js/views/setting/User.vue
index f7a60176..5eec75d2 100644
--- a/resources/js/views/setting/User.vue
+++ b/resources/js/views/setting/User.vue
@@ -5,6 +5,10 @@