PHPackages                             shift31/glean - 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. shift31/glean

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

shift31/glean
=============

Generate fixture files from the output of any object method

1.0(11y ago)1571MITPHPPHP &gt;=5.4.0

Since Dec 29Pushed 11y ago1 watchersCompare

[ Source](https://github.com/shift31/glean)[ Packagist](https://packagist.org/packages/shift31/glean)[ RSS](/packages/shift31-glean/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (3)Versions (3)Used By (0)

Glean
=====

[](#glean)

**A fixture generator for Laravel**

This library provides a Laravel Artisan command which generates fixture files from the output of any object method. It leverages Laravel's Service Container and PHP's Reflection capabilities to instantiate classes and call the desired object methods with the specified arguments. Data may be saved in raw PHP, YAML, JSON, or XML.

Use Case
--------

[](#use-case)

While there are quite a few test double libraries designed to ingest fixtures (which reflect model classes) for the purpose of database seeding, in complex applications, it may be desirable to have reusable fixture data from other types of classes (i.e. services). *Glean* provides an easy way to capture arbitrary/complex data structures. The fixture files generated by this tool are intended to be used with unit tests in any case where you might need to reuse expectation data (i.e. stubbing).

Usage
-----

[](#usage)

1. `composer require shift31/glean`
2. Add `Shift31\Glean\GleanServiceProvider` to the `'providers'` array in your app/config/app.php.

### Help

[](#help)

Run `php artisan help glean` from the root of your Laravel project

### Examples

[](#examples)

Imagine a `Acme\Users\UsersService` class with a `getUserRoles($userId)` method that returns an array of roles for a particular user:

`php artisan glean -a user_roles 'Acme\Users\UsersService' getUserRoles 12345`

By default, this will generate a PHP file in app/storage/fixtures called user\_roles.php with the data *gleaned* from `UsersService::getUserRoles`.

#### With interfaces

[](#with-interfaces)

*Glean* resolves classes using Laravel's Service Container, so feel free to specify an interface for the `className` argument.

#### In a test

[](#in-a-test)

```
$expectedUserRoles = include(__DIR__ . '/../app/storage/fixtures/user_roles.php');
```

Limitations
-----------

[](#limitations)

Method arguments can only be PHP scalar values or `null`. A possible workaround for this is to extend the `GleanCommand` class and create your own custom "gleaner."

Todo
----

[](#todo)

- Build a fixture loader
- Make it framework-agnostic?
- Make writing custom gleaners easier?

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 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

Unknown

Total

1

Last Release

4205d ago

### Community

Maintainers

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

---

Top Contributors

[![bgetsug](https://avatars.githubusercontent.com/u/1869022?v=4)](https://github.com/bgetsug "bgetsug (3 commits)")

### Embed Badge

![Health badge](/badges/shift31-glean/health.svg)

```
[![Health](https://phpackages.com/badges/shift31-glean/health.svg)](https://phpackages.com/packages/shift31-glean)
```

###  Alternatives

[craftcms/cms

Craft CMS

3.6k3.6M3.1k](/packages/craftcms-cms)[laravel/sail

Docker files for running a basic Laravel application.

1.9k205.7M1.3k](/packages/laravel-sail)[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[friendsoftypo3/content-blocks

TYPO3 CMS Content Blocks - Content Types API | Define reusable components via YAML

103519.9k53](/packages/friendsoftypo3-content-blocks)[flarum/core

Delightfully simple forum software.

201.4M2.3k](/packages/flarum-core)[rcsofttech/audit-trail-bundle

Enterprise-grade, high-performance Symfony audit trail bundle. Automatically track Doctrine entity changes with split-phase architecture, multiple transports (HTTP, Queue, Doctrine), and sensitive data masking.

1189.8k](/packages/rcsofttech-audit-trail-bundle)

PHPackages © 2026

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