Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace Modules\Basic\Http\Livewire\Setup;
- use Illuminate\View\View;
- use Livewire\Component;
- use Modules\Basic\Enums\BasicParameter;
- use Modules\Basic\Helper\ParameterHelper;
- class Stepper extends Component
- {
- // General
- public int $currentStep = 1;
- // Step 2
- public string $name = '';
- public string $language = '';
- public function mount()
- {
- // Get the current setup step from the db
- // Add 1 to the step, because index starts at 0
- $this->currentStep = tenant()->setup_step->value + 1;
- // Initialize the saved data
- $this->initializeParameterValues();
- }
- /**
- * Get the view / contents that represent the component.
- *
- * @return View|string
- */
- public function render(): string|View
- {
- return view('basic::livewire.setup.stepper');
- }
- private function initializeParameterValues()
- {
- // Get the step data from the db
- $stepValues = ParameterHelper::getValue(BasicParameter::SETUP_STEP_DATA, []);
- // Step 2
- $this->name = $stepValues['name'] ?? tenant()->name;
- $this->language = $stepValues['language'] ?? 'en';
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement