PHPackages                             stuartcusackie/statamic-blade-view-data - 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. [Templating &amp; Views](/categories/templating)
4. /
5. stuartcusackie/statamic-blade-view-data

ActiveLibrary[Templating &amp; Views](/categories/templating)

stuartcusackie/statamic-blade-view-data
=======================================

Access Statamic variables from any blade view or component.

1.1.14(3y ago)1105MITPHPPHP ^8.0

Since Jul 3Pushed 3y ago1 watchersCompare

[ Source](https://github.com/stuartcusackie/statamic-blade-view-data)[ Packagist](https://packagist.org/packages/stuartcusackie/statamic-blade-view-data)[ RSS](/packages/stuartcusackie-statamic-blade-view-data/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (2)Versions (27)Used By (0)

Statamic Blade View Data
========================

[](#statamic-blade-view-data)

Facades to access Statamic data from within Blade components. This package extracts the Statamic data that is passed to your selected template and adds it to a singleton that can be accessed anywhere in your application.

DO NOT USE
----------

[](#do-not-use)

Since writing this package the devs at Statamic have found a better way to access Statamic data. Use the Cascade facade in any controller or blade component:

```
use Facades\Statamic\View\Cascade;

$cascade = Cascade::instance()->toArray();
$page = $cascade['page'];
$globalAnalytics = $cascade['analytics'];

```

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

[](#installation)

```
composer require stuartcusackie/statamic-blade-view-data

```

Usage
-----

[](#usage)

A Laravel facade is provided by the package. It has a few methods:

- StatData::context() - Returns all of the view data
- StatData::page() - Returns the Statamic page object
- StatData::site() - Returns Statamic site object
- StatData::globalSet('social') - Returns a specific global set

To use it in blade views:

```
StatData::globalSet('social')['facebook_url']

```

To use it in classes we need a forward slash:

```
$page = \StatData::page();

```

Custom Routes
-------------

[](#custom-routes)

Custom routes that are set up in web.php and that use custom controllers won't be initialised with the Statamic data.

If you are returning a view in your custom controllers then you can initialise the blade data like so:

```
View::composer('pages/custom-view', function ($view) {
  \StatData::init($viewData);
});

return (new \Statamic\View\View)
  ->template('pages/custom-view')
  ->layout('layouts/app')
  ->with(['page' => $page]);

```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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 ~4 days

Recently: every ~11 days

Total

26

Last Release

1308d ago

Major Versions

0.0.9 → 1.0.02022-07-07

### Community

Maintainers

![](https://www.gravatar.com/avatar/9b3b7f67ae3b509c07e97c7bf803427ae0965adeed933daa02bffc2a37c08333?d=identicon)[stuartcusackie](/maintainers/stuartcusackie)

---

Top Contributors

[![stuartcusackie](https://avatars.githubusercontent.com/u/20210934?v=4)](https://github.com/stuartcusackie "stuartcusackie (51 commits)")

### Embed Badge

![Health badge](/badges/stuartcusackie-statamic-blade-view-data/health.svg)

```
[![Health](https://phpackages.com/badges/stuartcusackie-statamic-blade-view-data/health.svg)](https://phpackages.com/packages/stuartcusackie-statamic-blade-view-data)
```

###  Alternatives

[cagilo/cagilo

A set of open-source Blade components for the Laravel Framework

172996.5k](/packages/cagilo-cagilo)[statamic-rad-pack/runway

Eloquently manage your database models in Statamic.

135192.6k5](/packages/statamic-rad-pack-runway)[stillat/antlers-components

2656.0k1](/packages/stillat-antlers-components)[orchid/blade-icons

An easy way inline SVG images in your Blade templates.

223.4M9](/packages/orchid-blade-icons)[wireui/heroicons

The Tailwind Heroicons for laravel blade by WireUI

43390.8k5](/packages/wireui-heroicons)[itstructure/laravel-grid-view

Grid view for laravel framework

2546.6k2](/packages/itstructure-laravel-grid-view)

PHPackages © 2026

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