PHPackages                             stefblokdijk/laravel-prismic-helper - 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. stefblokdijk/laravel-prismic-helper

ActiveLibrary

stefblokdijk/laravel-prismic-helper
===================================

Prismic Helper for Laravel

1471PHPCI failing

Since Mar 17Pushed 5y ago1 watchersCompare

[ Source](https://github.com/stefblokdijk/laravel-prismic-helper)[ Packagist](https://packagist.org/packages/stefblokdijk/laravel-prismic-helper)[ RSS](/packages/stefblokdijk-laravel-prismic-helper/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependenciesVersions (1)Used By (0)

Prismic Helper for Laravel
==========================

[](#prismic-helper-for-laravel)

[![Latest Version on Packagist](https://camo.githubusercontent.com/c247bf50d2b2ae7629a4ff409029fd201eacb3bd7c0b2a295451a3f4e4b4f524/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73746566626c6f6b64696a6b2f6c61726176656c2d707269736d69632d68656c7065722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/stefblokdijk/laravel-prismic-helper)[![Total Downloads](https://camo.githubusercontent.com/f424a8664ae2c9a95e7fe91f76e51a5f3b88d08f79fda574b8870b344ecdd6e4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f73746566626c6f6b64696a6b2f6c61726176656c2d707269736d69632d68656c7065722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/stefblokdijk/laravel-prismic-helper)

Work In Progress package to easily use the main functionalities of Prismic in your Laravel Project

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

[](#installation)

You can install the package via composer:

```
composer require stefblokdijk/laravel-prismic-helper
```

Add the following to your `.env` file

```
PRISMIC_REPOSITORY_URL=https://example.cdn.prismic.io/api/v2

```

If you are using a multilanguage repository, you can also set the default language in your `.env`

```
PRISMIC_LANGUAGE=nl

```

Examples
--------

[](#examples)

#### Get Content from a single type

[](#get-content-from-a-single-type)

```
use LaravelPrismicHelper;

LaravelPrismicHelper::getSingle($type);
```

#### Get Content from UID

[](#get-content-from-uid)

```
LaravelPrismicHelper::getByUID($uid, $type);
```

#### Get all items by an given type. This will return an collection

[](#get-all-items-by-an-given-type-this-will-return-an-collection)

```
LaravelPrismicHelper::getByType($type);
```

#### You can also filter using the `getByType` function:

[](#you-can-also-filter-using-the-getbytype-function)

```
// use options as second argument. Example: sort by by field (https://prismic.io/docs/php/query-the-api/order-your-result)
LaravelPrismicHelper::getByType($type, [
    'orderings' => '[my.news.date desc]'
]);

// Use multiple predicates as third arguments. Example: fullText search for the category (https://prismic.io/docs/php/query-the-api/fulltext-search)
use Prismic\Predicates;

LaravelPrismicHelper::getByType($type, [], [
    Predicates::fulltext('my.product.category', 'Some Category'),
]);
```

#### Query by Language

[](#query-by-language)

```
LaravelPrismicHelper::language('nl')->getSingle(type);
```

Helper functions for Blade templating
-------------------------------------

[](#helper-functions-for-blade-templating)

You have the following functions available to you:

*Function**Returns*`prismic_as_text($content, $key)`Plain text content`prismic_as_html($content, $key)`Html content`prismic_as_date($content, $key, $format)`ISO date format using `Carbon::isoFormat($format)``prismic_file_url($content, $key)`File Url`prismic_image_url($content, $key)`Image Url`prismic_image_alt($content, $key)`Image Alt Text`prismic_group($content, $key)`Collection of items#### Examples:

[](#examples-1)

```
{{ prismic_as_text($content, 'subtitle') }}

{{ prismic_as_date($content, 'created_at', 'LL') }}
```

#### Working with content groups

[](#working-with-content-groups)

```
@foreach(prismic_group($content, 'products') as $product)
    {{ prismic_as_text($product, 'name') }}
@endforeach
```

### Changelog

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

### Security

[](#security)

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

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity30

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/15145744?v=4)[Stef Blokdijk](/maintainers/stefblokdijk)[@stefblokdijk](https://github.com/stefblokdijk)

---

Top Contributors

[![stefblokdijk](https://avatars.githubusercontent.com/u/15145744?v=4)](https://github.com/stefblokdijk "stefblokdijk (19 commits)")

### Embed Badge

![Health badge](/badges/stefblokdijk-laravel-prismic-helper/health.svg)

```
[![Health](https://phpackages.com/badges/stefblokdijk-laravel-prismic-helper/health.svg)](https://phpackages.com/packages/stefblokdijk-laravel-prismic-helper)
```

PHPackages © 2026

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