Skip to content

Commit

Permalink
Merge pull request #1 from tompec/tompec-patch-1
Browse files Browse the repository at this point in the history
Fix code example
  • Loading branch information
freekmurze authored Jun 20, 2022
2 parents d953572 + 9d549f5 commit f719de6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ use Spatie\Onboard\Facades\Onboard;
Onboard::addStep('Complete Profile')
->link('/profile')
->cta('Complete')
->completeIf(function (User $model) {
->completeIf(function (User $user) {
return $user->profile->isComplete();
});

Onboard::addStep('Create Your First Post')
->link('/post/create')
->cta('Create Post')
->completeIf(function (User $model) {
->completeIf(function (User $user) {
return $user->posts->count() > 0;
});
```
Expand Down Expand Up @@ -105,14 +105,14 @@ class AppServiceProvider extends ServiceProvider
* injection here to inject anything else as well.
*/
->completeIf(function (User $model) {
return $user->profile->isComplete();
return $model->profile->isComplete();
});

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

Expand Down

0 comments on commit f719de6

Please sign in to comment.