mirror of
https://github.com/InvoiceShelf/InvoiceShelf.git
synced 2026-04-07 13:41:23 +00:00
47 lines
1.2 KiB
PHP
47 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace InvoiceShelf\Http\Controllers\V1\Installation;
|
|
|
|
use Illuminate\Http\Request;
|
|
use InvoiceShelf\Http\Controllers\Controller;
|
|
use InvoiceShelf\Models\Setting;
|
|
use InvoiceShelf\Space\InstallUtils;
|
|
|
|
class OnboardingWizardController extends Controller
|
|
{
|
|
/**
|
|
* Handle the incoming request.
|
|
*
|
|
* @return \Illuminate\Http\JsonResponse
|
|
*/
|
|
public function getStep(Request $request)
|
|
{
|
|
if (! InstallUtils::dbMarkerExists()) {
|
|
return response()->json([
|
|
'profile_complete' => 0,
|
|
]);
|
|
}
|
|
|
|
return response()->json([
|
|
'profile_complete' => Setting::getSetting('profile_complete'),
|
|
]);
|
|
}
|
|
|
|
public function updateStep(Request $request)
|
|
{
|
|
$setting = Setting::getSetting('profile_complete');
|
|
|
|
if ($setting === 'COMPLETED') {
|
|
return response()->json([
|
|
'profile_complete' => $setting,
|
|
]);
|
|
}
|
|
|
|
Setting::setSetting('profile_complete', $request->profile_complete);
|
|
|
|
return response()->json([
|
|
'profile_complete' => Setting::getSetting('profile_complete'),
|
|
]);
|
|
}
|
|
}
|