export const initialState = (steps, initialData = {}) => ({
steps,
stepIndex: 0,
data: initialData,
errors: {},
});
export const wizardMachine = {
initial: 'account',
states: {
account: {
next: 'profile',
canLeave: (data) => Boolean(data.email && data.password),
class WizardsController < ApplicationController
STEPS = %w[account profile confirm].freeze
before_action :set_step
def show
import { Injectable } from '@angular/core';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
@Injectable()
export class SignupFormService {
readonly form: FormGroup;
<?php
namespace App\Http\Requests\Wizard;
use Illuminate\Foundation\Http\FormRequest;