mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-17 15:52:15 +00:00
controller refactoring part 8
This commit is contained in:
@@ -0,0 +1,82 @@
|
||||
<?php
|
||||
namespace Domain\SetupWizard\Controllers;
|
||||
|
||||
use Illuminate\Support\Str;
|
||||
use Illuminate\Http\Response;
|
||||
use Domain\Settings\Models\Setting;
|
||||
use App\Http\Controllers\Controller;
|
||||
use Domain\SetupWizard\Requests\StoreAppSetupRequest;
|
||||
|
||||
class StoreAppSettingsController extends Controller
|
||||
{
|
||||
/**
|
||||
* Store app settings
|
||||
*/
|
||||
public function __invoke(
|
||||
StoreAppSetupRequest $request
|
||||
): Response {
|
||||
collect([
|
||||
[
|
||||
'name' => 'app_title',
|
||||
'value' => $request->input('title'),
|
||||
],
|
||||
[
|
||||
'name' => 'app_description',
|
||||
'value' => $request->input('description'),
|
||||
],
|
||||
[
|
||||
'name' => 'app_logo',
|
||||
'value' => store_system_image($request, 'logo'),
|
||||
],
|
||||
[
|
||||
'name' => 'app_logo_horizontal',
|
||||
'value' => store_system_image($request, 'logo_horizontal'),
|
||||
],
|
||||
[
|
||||
'name' => 'app_favicon',
|
||||
'value' => store_system_image($request, 'favicon'),
|
||||
],
|
||||
[
|
||||
'name' => 'app_og_image',
|
||||
'value' => store_system_image($request, 'og_image'),
|
||||
],
|
||||
[
|
||||
'name' => 'app_touch_icon',
|
||||
'value' => store_system_image($request, 'touch_icon'),
|
||||
],
|
||||
[
|
||||
'name' => 'google_analytics',
|
||||
'value' => $request->input('googleAnalytics'),
|
||||
],
|
||||
[
|
||||
'name' => 'contact_email',
|
||||
'value' => $request->input('contactMail'),
|
||||
],
|
||||
[
|
||||
'name' => 'registration',
|
||||
'value' => $request->input('userRegistration'),
|
||||
],
|
||||
[
|
||||
'name' => 'storage_limitation',
|
||||
'value' => $request->input('storageLimitation'),
|
||||
],
|
||||
[
|
||||
'name' => 'storage_default',
|
||||
'value' => $request->input('defaultStorage') ?? 5,
|
||||
],
|
||||
])->each(function ($col) {
|
||||
Setting::forceCreate([
|
||||
'name' => $col['name'],
|
||||
'value' => $col['value'],
|
||||
]);
|
||||
});
|
||||
|
||||
if (! app()->runningUnitTests()) {
|
||||
setEnvironmentValue([
|
||||
'APP_NAME' => Str::camel($request->input('title')),
|
||||
]);
|
||||
}
|
||||
|
||||
return response('Done', 204);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user