Skip to content

Commit

Permalink
Merge pull request #11 from mpociot/add-arrayable-support
Browse files Browse the repository at this point in the history
Add Arrayable support
  • Loading branch information
freekmurze authored Aug 10, 2022
2 parents f67138f + 70006a5 commit 7e441ad
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 7e441ad

Please sign in to comment.