Skip to content

Commit

Permalink
Add arrayable support
Browse files Browse the repository at this point in the history
  • Loading branch information
mpociot committed Aug 10, 2022
1 parent f67138f commit 70006a5
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/OnboardingStep.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [];

Expand Down Expand Up @@ -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(),
]);
}
}

0 comments on commit 70006a5

Please sign in to comment.