mirror of
https://github.com/crater-invoice/crater.git
synced 2025-10-27 03:31:09 -04:00
* Create PHP CS Fixer config and add to CI workflow * Run php cs fixer on project * Add newline at end of file * Update to use PHP CS Fixer v3 * Run v3 config on project * Run seperate config in CI
47 lines
1.2 KiB
PHP
47 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace Crater\Http\Controllers\V1\Onboarding;
|
|
|
|
use Crater\Http\Controllers\Controller;
|
|
use Crater\Models\Setting;
|
|
use Illuminate\Http\Request;
|
|
|
|
class OnboardingWizardController extends Controller
|
|
{
|
|
/**
|
|
* Handle the incoming request.
|
|
*
|
|
* @param \Illuminate\Http\Request $request
|
|
* @return \Illuminate\Http\Response
|
|
*/
|
|
public function getStep(Request $request)
|
|
{
|
|
if (! \Storage::disk('local')->has('database_created')) {
|
|
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'),
|
|
]);
|
|
}
|
|
}
|