PHPackages                             arielenter/laravel-code-snippets - 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. arielenter/laravel-code-snippets

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

arielenter/laravel-code-snippets
================================

Collection of little helpers neither big nor relevant enough to be their own packages.

2.0.0(7mo ago)041GPL-3.0PHP

Since Sep 21Pushed 7mo agoCompare

[ Source](https://github.com/arielenter/laravel-code-snippets)[ Packagist](https://packagist.org/packages/arielenter/laravel-code-snippets)[ RSS](/packages/arielenter-laravel-code-snippets/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (4)Versions (3)Used By (1)

[Español](README.es.md)

**Laravel Code Snippets**
=========================

[](#laravel-code-snippets)

Collection of little helpers neither big nor relevant enough to be their own packages.

trait CreateReadme
------------------

[](#trait-createreadme)

Provides helpers to create ‘README.md’ files.

### method createReadmeFromTemplate

[](#method-createreadmefromtemplate)

```
/**
 * A ‘README.md’ is created using a template file for the given language.
 *
 * The function ‘trans’ or ‘__’ is used to get the resulting
 * ‘readme’ file. With this in mind, the template file must use placeholders
 * in the form of ‘:key_to_translate’ style, and the replace values have to
 * be given in an array where keys are the placeholders and the values are the
 * desired replace text.
 *
 * @param string               $template Path to the template file.
 * @param string               $locale   ISO language code that the resulting
 *                                       readme file is made for, using
 *                                       ‘README.xx.md’ style to name it,
 *                                       unless it’s equal to the
 *                                       application’s current language, in
 *                                       which case ‘README.md’ name is used
 *                                       instead.
 * @param ?int                 $wrap     If an integer is given instead of null,
 *                                       the text inside the resulting
 *                                       ‘readme’ file will be wrapped using
 *                                       this value as the width.
 * @param array $replace  Replace values that will be used on the
 *                                       template’s placeholders.
 *
 * @return string The generated content for the file
 */
```

### method getLocaleLinks

[](#method-getlocalelinks)

```
/**
 * Producess the ‘md’ code corresponding to hyper links for every readme
 * file of every given language.
 *
 * @param array $availableLocales ISO code as key and name as
 *                                               value of every available
 *                                               language.
 * @param string               $exception        Optional. ISO code of the
 *                                               language we might want to leave
 *                                               out.
 * @param string               $separator        Optional. Text that should
 *                                               separate each link. By default
 *                                               it’s ‘ | ’.
 *
 * @return string Hyper links to every README file.
 */
```

class ComposerJson
------------------

[](#class-composerjson)

Provides helpers to perform oparations over composer’s json file.

### method editKey

[](#method-editkey)

```
/**
 * Changes the value of the given key. If the key doesn’t exist, it will be
 * added.
 *
 * @param string $key   Key
 * @param string $value Value
 *
 * @return void
 */
```

trait TestAssertion
-------------------

[](#trait-testassertion)

Meant to be use on laravel’s phpunit TestCases to provide trait methods to test assertions.

### method assertClosureThrowsAsserionFail

[](#method-assertclosurethrowsasserionfail)

```
/**
 * Asserts that the given closure triggers an asssertion fail error.
 *
 * @param Closure $closure Closure to be tested.
 * @param ?string $failMsg If provided, makes sure that the expected resulting
 *                         assertion fail error throws the expected message.
 *
 * @return void
 */
```

License
-------

[](#license)

GNU General Public License (GPL) version 3

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance64

Regular maintenance activity

Popularity3

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity37

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.

###  Release Activity

Cadence

Every ~69 days

Total

2

Last Release

216d ago

Major Versions

1.0.0 → 2.0.02025-11-29

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/15250852?v=4)[arielenter](/maintainers/arielenter)[@arielenter](https://github.com/arielenter)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/arielenter-laravel-code-snippets/health.svg)

```
[![Health](https://phpackages.com/badges/arielenter-laravel-code-snippets/health.svg)](https://phpackages.com/packages/arielenter-laravel-code-snippets)
```

###  Alternatives

[yii2mod/yii2-star-rating

Star rating widget based on jQuery Raty https://github.com/wbotelhos/raty

1915.5k](/packages/yii2mod-yii2-star-rating)[inspiredminds/contao-fieldset-duplication

Contao extension to allow the duplication of form fieldsets in the front end by the user for additional input fields.

158.6k2](/packages/inspiredminds-contao-fieldset-duplication)

PHPackages © 2026

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