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 today

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 52% 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

1355d ago

Major Versions

0.0.9 → 1.0.02022-07-07

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/20210934?v=4)[Stuart Cusack](/maintainers/stuartcusackie)[@stuartcusackie](https://github.com/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

[statamic-rad-pack/runway

Eloquently manage your database models in Statamic.

135224.7k7](/packages/statamic-rad-pack-runway)[duncanmcclean/statamic-cargo

Comprehensive e-commerce addon for Statamic. Build bespoke e-commerce sites without the complexity.

3417.0k](/packages/duncanmcclean-statamic-cargo)[statamic/statamic

Statamic

829179.5k](/packages/statamic-statamic)[api-platform/laravel

API Platform support for Laravel

58171.6k14](/packages/api-platform-laravel)[stillat/antlers-components

2763.2k1](/packages/stillat-antlers-components)

PHPackages © 2026

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