diff --git a/README.md b/README.md index b96486f..0011ab1 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,53 @@ [](https://github.com/spatie/laravel-onboard/actions?query=workflow%3A"Check+%26+fix+styling"+branch%3Amain) [](https://packagist.org/packages/spatie/laravel-onboard) +This package lets you set up an onboarding flow for your application's users. + +Here's an example of how it's set up: + +```php +use App\User; +use Spatie\Onboard\Facades\Onboard; + +Onboard::addStep('Complete Profile') + ->link('/profile') + ->cta('Complete') + ->completeIf(function (User $model) { + return $user->profile->isComplete(); + }); + +Onboard::addStep('Create Your First Post') + ->link('/post/create') + ->cta('Create Post') + ->completeIf(function (User $model) { + return $user->posts->count() > 0; + }); +``` + +You can then render this onboarding flow however you want in your templates: + +```blade +@if (auth()->user()->onboarding()->inProgress()) +