PHPackages                             agelxnash/mod-laravel - 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. agelxnash/mod-laravel

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

agelxnash/mod-laravel
=====================

Launch snippets from content (by CMS MODX Evolution)

48361PHP

Since Apr 4Pushed 8y ago1 watchersCompare

[ Source](https://github.com/AgelxNash/modLaravel)[ Packagist](https://packagist.org/packages/agelxnash/mod-laravel)[ RSS](/packages/agelxnash-mod-laravel/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Configuration
=============

[](#configuration)

You will want to run the following command to publish the config to your application, otherwise it will be overwritten when the package is updated.

```
php artisan vendor:publish --provider="AgelxNash\modLaravel\ServiceProvider"
```

Now you can edit the file `config/modx.php`

Usage
=====

[](#usage)

Create your snippet in the config file `config/modx.php`

```
return array(
    'snippets' => array(
        'user' => function($params){
            $id = isset($params['id']) ? (int)$params['id'] : 0;
            $field = (isset($params['field']) && in_array($params['field'], array('name', 'email'))) ? (string)$params['field'] : 'name';
            $userObj = App\Models\User::findOrNew($id);
            return $userObj->{$field};
        }
    )
);
```

Now you can call a snippet `user`

```
$text = 'Some data: [[example? &id=`asd`]]. User: [[user? &id=`2`]]';
return Modx::mergeSnippets($text);
```

As a result, you get something like this

```
Some data: Array ( [id] => asd ). User: Admin

```

Attention
=========

[](#attention)

Do not get carried away with this garbage. It is absolutely safe and can lead to cracking of your site.

Why You Need
============

[](#why-you-need)

For example, you have a slider. And you want to insert it in any place

See
===

[](#see)

-

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/cd6eeb152aa8a6a81b05883f09f583f4fafbc50935495d79a2d8a01e0e5f9aa6?d=identicon)[Agel Nash](/maintainers/Agel%20Nash)

---

Top Contributors

[![AgelxNash](https://avatars.githubusercontent.com/u/1748872?v=4)](https://github.com/AgelxNash "AgelxNash (6 commits)")

### Embed Badge

![Health badge](/badges/agelxnash-mod-laravel/health.svg)

```
[![Health](https://phpackages.com/badges/agelxnash-mod-laravel/health.svg)](https://phpackages.com/packages/agelxnash-mod-laravel)
```

###  Alternatives

[karlmonson/laravel-ping

Simple Ping For Laravel Applications

2939.4k](/packages/karlmonson-laravel-ping)[irfa/php-gatcha

Simple Items Gatcha with PHP

362.4k](/packages/irfa-php-gatcha)

PHPackages © 2026

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