diff --git a/src/OnboardingStep.php b/src/OnboardingStep.php index 4bc3e84..4d11b1b 100644 --- a/src/OnboardingStep.php +++ b/src/OnboardingStep.php @@ -2,10 +2,11 @@ namespace Spatie\Onboard; +use Illuminate\Contracts\Support\Arrayable; use Illuminate\Support\Arr; use Spatie\Onboard\Concerns\Onboardable; -class OnboardingStep +class OnboardingStep implements Arrayable { protected array $attributes = []; @@ -111,4 +112,12 @@ public function __isset(string $key): bool { return isset($this->attributes[$key]); } + + public function toArray() + { + return array_merge($this->attributes, [ + 'complete' => $this->complete(), + 'excluded' => $this->excluded(), + ]); + } }