PHPackages                             stats4sd/laravel-backpack-section-title - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. stats4sd/laravel-backpack-section-title

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

stats4sd/laravel-backpack-section-title
=======================================

A custom Backpack Field that lets you easily add custom headings and information boxes to split up the form.

1.2.0(2y ago)34272[1 issues](https://github.com/stats4sd/laravel-backpack-section-title/issues)1MITPHPCI passing

Since Apr 13Pushed 1y ago1 watchersCompare

[ Source](https://github.com/stats4sd/laravel-backpack-section-title)[ Packagist](https://packagist.org/packages/stats4sd/laravel-backpack-section-title)[ Docs](https://github.com/stats4sd/laravel-backpack-section-title)[ RSS](/packages/stats4sd-laravel-backpack-section-title/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (4)Versions (5)Used By (1)

LaravelBackpackSectionTitle
===========================

[](#laravelbackpacksectiontitle)

[![Latest Version on Packagist](https://camo.githubusercontent.com/40573df7456b93a591ca99d947242fe9d6b9c1d8a50517c02827511091802192/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73746174733473642f6c61726176656c2d6261636b7061636b2d73656374696f6e2d7469746c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/stats4sd/laravel-backpack-section-title)[![Total Downloads](https://camo.githubusercontent.com/34e0e066126c9deb3d4364ef943784c3270f7d75456896f962b9dd32e53617cb/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f73746174733473642f6c61726176656c2d6261636b7061636b2d73656374696f6e2d7469746c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/stats4sd/laravel-backpack-section-title)[![The Whole Fruit Manifesto](https://camo.githubusercontent.com/9fc65ecdd629dc33c369f73e0bc051740f01647367c131a574577fea2a5678bb/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f77726974696e672532307374616e646172642d74686525323077686f6c6525323066727569742d627269676874677265656e)](https://github.com/the-whole-fruit/manifesto)

This package provides a new `section-title` Backpack field type for use in your create/edit forms that lets you easily add a nicely styled header and/or information text to your Backpack forms.

This package was created using the [Laravel Backpack Addon Skeleton](https://github.com/Laravel-Backpack/addon-skeleton) provided by the Backpack team.

Screenshots
-----------

[](#screenshots)

[![image](https://user-images.githubusercontent.com/5711101/163187339-b54f12f0-efc1-4769-b967-a7851d59673c.png)](https://user-images.githubusercontent.com/5711101/163187339-b54f12f0-efc1-4769-b967-a7851d59673c.png)Code used to generate the screenshot: [example-for-screenshot.php](https://github.com/stats4sd/laravel-backpack-section-title/blob/main/example-for-screenshot.php)

Installation
------------

[](#installation)

Via Composer

```
composer require stats4sd/laravel-backpack-section-title
```

Usage
-----

[](#usage)

```
$this->crud->addField([
    'name' => 'field_name',
    'type' => 'section-title',
    'title' => 'Your Heading',
    'content' => 'Some information about how to complete the form, to be displayed inside a callout box',
    'variant' => 'info',
    'divider' => true,
    'view_namespace' => 'stats4sd.laravel-backpack-section-title::fields',
]);
```

Notice the `view_namespace` attribute - make sure that is exactly as above, to tell Backpack to load the field from this *addon package*, instead of assuming it's inside the *Backpack\\CRUD package*.

Optional properties:

- `title` (string or closure) - text to be displayed inside an `` tag.
- `content` (string or closure) - text to be displayed inside a padded callout box. You can use any html here, and it will be rendered without stipping tags.
- `variant` (string) - You can use any of the Bootstrap 4 keywords to change the colour of the left border. (e.g. primary, secondary, success, info, warning, danger, light, dark). It defaults to 'info' if left null.
- `divider` (boolean) - If set to TRUE, this adds an `` tag above the header, in case you want an even clearer visual divide between content sections.

> NOTE: The content box is rendered with `{!!  !!}`, so there is no safety net! Make sure you never pass user content directly into the content field without sanitising it first...

### Injecting $entry variables into the text

[](#injecting-entry-variables-into-the-text)

When doing an Update Operation, you may want to use some properties of the existing record in the title or content of the field. You can do this by making either property a closure with a single parameter "$entry". Your function should return the string you want rendered. For example:

```
$this->crud->addField([
    'name' => 'dynamic title',
    'type' => 'section-title',
    'title' => function($entry) {
        return "Editing " . $entry['name'];
    }
]);
```

Note that if you include this in the Create operation, $entry will be null, so write your closure to account for that. For example:

```
$this->crud->addField([
    'name' => 'dynamic title',
    'type' => 'section-title',
    'title' => function($entry) {
        if($entry) {
            return "Editing " . $entry['name'];
        } else {
            return "Creating new entry";
        }
    }
]);
```

Overwriting
-----------

[](#overwriting)

If you need to change the field in any way, you can easily publish the file to your app, and modify that file any way you want. But please keep in mind that you will not be getting any updates.

**Step 1.** Copy-paste the blade file to your directory:

```
# create the fields directory if it's not already there
mkdir -p resources/views/vendor/backpack/crud/fields

# copy the blade file inside the folder we created above
cp -i vendor/stats4sd/laravel-backpack-section-title/resources/views/fields/section-title.blade.php resources/views/vendor/backpack/crud/fields/section-title.blade.php
```

**Step 2.** Remove the vendor namespace wherever you've used the field:

```
$this->crud->addField([
    'name' => 'agreed',
    'type' => 'toggle',
    'label' => 'I agree to the terms and conditions',
-   'view_namespace' => 'stats4sd.laravel-backpack-section-title::fields'
]);
```

**Step 3.** Uninstall this package. Since it only provides one file, and you're no longer using that file, it makes no sense to have the package installed:

```
composer remove stats4sd/laravel-backpack-section-title
```

Change log
----------

[](#change-log)

Changes are documented here on Github. Please see the [Releases tab](https://github.com/stats4sd/laravel-backpack-section-title/releases).

Contributing
------------

[](#contributing)

Please see [contributing.md](contributing.md) for a todolist and howtos.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Dave Mills](https://github.com/stats4sd)
- [All Contributors](../../contributors)

License
-------

[](#license)

This project was released under MIT, so you can install it on top of any Backpack &amp; Laravel project. Please see the [license file](license.md) for more information.

However, please note that you do need Backpack installed, so you need to also abide by its [YUMMY License](https://github.com/Laravel-Backpack/CRUD/blob/master/LICENSE.md). That means in production you'll need a Backpack license code. You can get a free one for non-commercial use (or a paid one for commercial use) on [backpackforlaravel.com](https://backpackforlaravel.com).

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance28

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 73.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~227 days

Total

3

Last Release

1032d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2a7ba5ca40fde83339632231db5f6a95522c1de137f0029a338a5d90fa449a46?d=identicon)[dave-mills](/maintainers/dave-mills)

---

Top Contributors

[![dave-mills](https://avatars.githubusercontent.com/u/5711101?v=4)](https://github.com/dave-mills "dave-mills (11 commits)")[![ciara-mc](https://avatars.githubusercontent.com/u/56551262?v=4)](https://github.com/ciara-mc "ciara-mc (2 commits)")[![dan-tang-ssd](https://avatars.githubusercontent.com/u/86968034?v=4)](https://github.com/dan-tang-ssd "dan-tang-ssd (1 commits)")[![edrisaturay](https://avatars.githubusercontent.com/u/21174548?v=4)](https://github.com/edrisaturay "edrisaturay (1 commits)")

---

Tags

laravelbackpackBackpack for LaravelBackpack AddonLaravelBackpackSectionTitle

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/stats4sd-laravel-backpack-section-title/health.svg)

```
[![Health](https://phpackages.com/badges/stats4sd-laravel-backpack-section-title/health.svg)](https://phpackages.com/packages/stats4sd-laravel-backpack-section-title)
```

###  Alternatives

[backpack/theme-tabler

UI for Backpack v6 that uses Tabler and Bootstrap v5.

35536.5k](/packages/backpack-theme-tabler)[backpack/activity-log

Activity Log for Backpack

3487.5k1](/packages/backpack-activity-log)[backpack/translation-manager

Translation Manager for Backpack

5118.9k1](/packages/backpack-translation-manager)[backpack/medialibrary-uploaders

Helper functions to save files with spatie media library

1373.3k](/packages/backpack-medialibrary-uploaders)[figlabhq/crud-resource-for-backpack

Build CRUD panels using fluent field definitions.

122.1k](/packages/figlabhq-crud-resource-for-backpack)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
