Skip to content

Commit

Permalink
Added example of chaining additional completeIf for a different model
Browse files Browse the repository at this point in the history
  • Loading branch information
titonova authored Dec 12, 2024
1 parent 7aa0d55 commit 5e19be1
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,20 @@ Now you can access these steps along with their state wherever you like. Here is
@endif
```

You can also attach an additional `completeIf` metheod with a different model:

```php
Onboard::addStep('Create Your First Post')
->link('/post/create')
->cta('Create Post')
->completeIf(function (User $model) {
return $model->posts->count() > 0;
})
->completeIf(function (Business $model) {
return $model->posts->count() > 0 && $model->owner()->isAllowedToPost();
});
```

Check out all the available features below:

```php
Expand Down

0 comments on commit 5e19be1

Please sign in to comment.