PHPackages                             pvtl/voyager-page-blocks - 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. [Admin Panels](/categories/admin)
4. /
5. pvtl/voyager-page-blocks

AbandonedArchivedLibrary[Admin Panels](/categories/admin)

pvtl/voyager-page-blocks
========================

Ahoy! - A package to implement page blocks into Voyager

0.10.1(5y ago)7512.8k↓33.3%26[4 issues](https://github.com/pvtl/voyager-page-blocks/issues)1MITPHP

Since Feb 22Pushed 4y ago5 watchersCompare

[ Source](https://github.com/pvtl/voyager-page-blocks)[ Packagist](https://packagist.org/packages/pvtl/voyager-page-blocks)[ RSS](/packages/pvtl-voyager-page-blocks/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (2)Versions (42)Used By (1)

**This repository is no longer actively maintained**

Voyager Page Blocks
===================

[](#voyager-page-blocks)

[![Voyager Frontend Screenshot](/readme-intro.jpg)](/readme-intro.jpg)

This [Laravel](https://laravel.com/)/[Voyager Frontend](https://github.com/pvtl/voyager-frontend) module is designed to give developers the ability to easily design page blocks, for Voyager admin users to build stunning frontend pages.

Built by [Pivotal Agency](https://pivotal.agency/).

---

Prerequisites
-------------

[](#prerequisites)

- Composer Installed
- [Install Laravel](https://laravel.com/docs/installation)
- [Install Voyager](https://github.com/the-control-group/voyager)
- [Install Voyager Frontend](https://github.com/pvtl/voyager-frontend)

---

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

[](#installation)

```
# 1. Require this Package in your fresh Laravel/Voyager project
composer require pvtl/voyager-page-blocks

# 2. Run the Installer
php artisan voyager-page-blocks:install

# 3. (Optional) Seed the database with example page blocks.
php artisan voyager-page-blocks:seed
```

---

Creating &amp; Modifying Blocks
-------------------------------

[](#creating--modifying-blocks)

Page blocks are created &amp; configured in 2 steps:

1. **Define** the block - in `/config/page-blocks.php`
2. **Build** the block's HTML layout - create the template in `/resources/views/vendor/voyager-page-blocks/blocks`

### 1. Define a Block

[](#1-define-a-block)

Familiarize yourself with `/config/page-blocks.php`. This is where you'll define each block - you'll tell it which fields the block should have (for the admin to manage) and which Blade template it should use on the frontend.

- Each array inside this configuration file is a page block
- Each block contains **fields**
- Each field contains a unique **field** key
- Each field is based on a **Voyager Data Type**

The below table explains what each property does and how it is relevant to the block itself:

KeyPurpose**Root key**This is the name of your page block, used to load the configurationnameThis is the display name of your page block, used in the block 'adder'fieldsThis is where your page block fields live (text areas, images etc)fields =&gt; fieldThe content name of your field, used to store/load its contentfields =&gt; display\_nameThe display name of this field in the back-endfields =&gt; typeThe data row type that this field will use (check `TCG\Voyager\FormFields`)fields =&gt; requiredSelf-explanatory, marks this field as required or not (not available for all partials)fields =&gt; placeholderSelf-explanatory, adds a placeholder to the field (not available for all partials)fields =&gt; detailsUsed for selects/checkboxes/radios to supply optionstemplateThis points to your blade file for your block templatecompatibleTBA### 2. Build the HTML

[](#2-build-the-html)

When you're ready to start structuring the display of your block, you'll need to create (or override our defaults) your blade template (located at `/resources/views/vendor/voyager-page-blocks/blocks/your_block.blade.php`) and use the accessors you defined in your module's configuration file to fetch each fields data (`{!! $blockData->image_content !!}`).

---

Example. Putting it all together
--------------------------------

[](#example-putting-it-all-together)

Let's say we want to create a new block with 1 WYSIWYG editor, called 'Company Overview'.

**Step 1. Define the new block**

In `/config/page-blocks.php`, we'll add:

```
$blocks['company_overview'] = [
    'name' => 'Company Overview',
    'template' => 'voyager-page-blocks::blocks.company_overview',
    'fields' => [
        'content' => [
            'field' => 'content',
            'display_name' => 'Company Overview Content',
            'type' => 'rich_text_box',
            'required' => 1,
            'placeholder' => 'Lorem ipsum dolor sit amet. Nullam in dui mauris.',
        ],
    ],
];
```

**Step 2. Build the HTML**

In `/resources/views/vendor/voyager-page-blocks/blocks`, we'll create a new file called `company_overview.blade.php` with:

```

        {!! $blockData->content !!}

```

**Step 3. Add the block to a page**

Next, jump into the Voyager Admin &gt; Pages and click 'Content' next to a page. You'll now be able to select `Company Overview` from the 'Add Block' section. Add the block to the page, drag/drop it into place, edit the text etc.

---

Developer Controller Blocks
---------------------------

[](#developer-controller-blocks)

You may also wish to include custom logic and functionality into your page blocks. This can be done with a **Developer Controller** Block - simply specify your controller namespace'd path and the method you wish to call, which should return a [view](https://laravel.com/docs/views) and you'll be on your way.

For example, the [Voyager Frontend](https://github.com/pvtl/voyager-frontend) package comes with a *Recent Posts* method/view that you can play with and review.

From the *Add Block* section of the page in the admin, add the block type of *Developer Controller*, then input the following into the path field:

```
Pvtl\VoyagerFrontend\Http\Controllers\PostController::recentBlogPosts(2)

```

This will output `2` blog posts on the frontend. You could change the first paramter of the method to 6, to output 6 blog posts. Simples.

---

Troubleshooting
---------------

[](#troubleshooting)

**It is important to sanitise your field output, null values will cause errors**.

It is very important that you follow the naming scheme that is setup in the example page blocks as the keys reference other cogs in the system to stitch the blocks together. There are example blocks already set up in the `resources/views` directory and configuration file for you to get started.

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity39

Limited adoption so far

Community24

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 50.6% 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 ~26 days

Recently: every ~42 days

Total

41

Last Release

1933d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b54f3e43a9171099a685589c94f7cd35da4da8e600d5737536d14918d872ca56?d=identicon)[pvtl](/maintainers/pvtl)

---

Top Contributors

[![Jean-PierreGassin](https://avatars.githubusercontent.com/u/6791304?v=4)](https://github.com/Jean-PierreGassin "Jean-PierreGassin (90 commits)")[![mcnamee](https://avatars.githubusercontent.com/u/1809236?v=4)](https://github.com/mcnamee "mcnamee (61 commits)")[![lukewmoore](https://avatars.githubusercontent.com/u/12770383?v=4)](https://github.com/lukewmoore "lukewmoore (13 commits)")[![Liam-PVTL](https://avatars.githubusercontent.com/u/57740837?v=4)](https://github.com/Liam-PVTL "Liam-PVTL (7 commits)")[![Liamso](https://avatars.githubusercontent.com/u/14972554?v=4)](https://github.com/Liamso "Liamso (3 commits)")[![OpJePl44tsm4n](https://avatars.githubusercontent.com/u/1597659?v=4)](https://github.com/OpJePl44tsm4n "OpJePl44tsm4n (2 commits)")[![wireblue](https://avatars.githubusercontent.com/u/1072538?v=4)](https://github.com/wireblue "wireblue (1 commits)")[![ajduff14](https://avatars.githubusercontent.com/u/7086583?v=4)](https://github.com/ajduff14 "ajduff14 (1 commits)")

---

Tags

laravellaravel-5-packagelaravel-packagephpvoyagerlaravelpageblocksfrontendvoyager

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/pvtl-voyager-page-blocks/health.svg)

```
[![Health](https://phpackages.com/badges/pvtl-voyager-page-blocks/health.svg)](https://phpackages.com/packages/pvtl-voyager-page-blocks)
```

###  Alternatives

[joy/voyager-datatable

joy voyager datatable

1538.1k43](/packages/joy-voyager-datatable)[monstrex/voyager-site

Voyager Site package

161.5k](/packages/monstrex-voyager-site)

PHPackages © 2026

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