---
title: "Sections — Onboarding for Laravel | Roundly"
description: "Group steps into named sections with their own progress — the building block for multi-part setup wizards."
url: https://roundly-consulting.com/open-source/docs/onboarding-for-laravel/sections
language: en
---

[All packages](https://roundly-consulting.com/open-source.md)

[Onboarding for Laravel](https://roundly-consulting.com/open-source/docs/onboarding-for-laravel.md)

# Sections

Group steps for larger journeys and read per-section progress. Steps with no group fall into the reserved general section (Flow::UNGROUPED\_SECTION):

```php
$flow = Onboarding::flow('default')->title('Account setup');

$flow->add('Upload photo')->group('profile')->completeWhenFilled('avatar_path');
$flow->add('Add card')->group('billing')->completeWhenFilled('card_last4');
$flow->add('Accept terms')->completeWhenFilled('terms_accepted_at'); // no group: "general"
```

```php
$flow = Onboarding::for($user);

$flow?->sections();                       // Collection<int, SectionData>
$flow?->groups();                         // alias of sections()
$flow?->section('billing')?->percentage;  // float
$flow?->section('billing')?->isCompleted; // bool — required steps in the group complete
```

Sections follow the order in which each group first appears in the ordered step list. A section’s percentage covers all its visible steps; its isCompleted is true once its required steps are complete.

## SectionData

Each section is a final readonly SectionData DTO — key, title (currently the group key), percentage, isCompleted and steps (a list of StepData) — implementing Arrayable and JsonSerializable. Serialized steps also carry their group key:

```php
[
    'key' => 'billing',
    'title' => 'billing',
    'percentage' => 0.0,
    'is_completed' => false,
    'steps' => [ /* list of StepData shapes */ ],
]
```

## A multi-part wizard

```blade
@foreach ($user->onboarding()?->sections() ?? [] as $section)
    <h3>{{ $section->title }} — {{ $section->percentage }}%</h3>

    <ul>
        @foreach ($section->steps as $step)
            <li @class(['is-done' => $step->isCompleted])>{{ $step->title }}</li>
        @endforeach
    </ul>
@endforeach
```

## Show your open-source love

This package is free and MIT-licensed. If it saves you time, a one-off donation or a Patreon membership keeps it maintained, tested and documented.

[More ways to support, including crypto](https://roundly-consulting.com/support-us.md)

By donating, you agree to our [donation terms](https://roundly-consulting.com/donation-terms.md).

[Support our open source work (opens in a new tab)](https://donate.stripe.com/dRmeVe8FX5PF1Qd9pXcEw00) [Join us on Patreon (opens in a new tab)](https://www.patreon.com/cw/roundly)

## Want this built into your product?

We integrate our packages into custom Laravel and AI builds. Tell us what you're working on and we'll reply within 48 hours.

[Get a quote in 48 hours](https://roundly-consulting.com/contact.md) [Browse all packages](https://roundly-consulting.com/open-source/docs/onboarding-for-laravel.md)
