PHPackages                             mpesic381/laravel-placeholders - 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. mpesic381/laravel-placeholders

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

mpesic381/laravel-placeholders
==============================

Find and Replace placeholder strings in Laravel 8

1.1.0(2y ago)08.5k↓33.3%MITPHPPHP ^7.4|^8.0|^8.1|^8.2

Since Jul 8Pushed 2y ago2 watchersCompare

[ Source](https://github.com/MPesic381/laravel-placeholders)[ Packagist](https://packagist.org/packages/mpesic381/laravel-placeholders)[ Docs](https://github.com/mpesic381/laravel-placeholders)[ RSS](/packages/mpesic381-laravel-placeholders/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (3)Versions (3)Used By (0)

Find and Replace placeholder strings in Laravel 8 and newer
===========================================================

[](#find-and-replace-placeholder-strings-in-laravel-8-and-newer)

[![Latest Version on Packagist](https://camo.githubusercontent.com/d9e4d334e6424c1c6019b8122002ce6563055f25c876c232a0a71dc545fcb72b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d70657369633338312f6c61726176656c2d706c616365686f6c646572732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/mpesic381/laravel-placeholders)[![Total Downloads](https://camo.githubusercontent.com/468f28c4e566992985e52db4c88aff74367adf785a6276fb33617d615f93601c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d70657369633338312f6c61726176656c2d706c616365686f6c646572732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/mpesic381/laravel-placeholders)

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

[](#installation)

You can install the package via composer:

```
composer require mpesic381/laravel-placeholders
```

Then you will need to run these commands in the terminal in order to copy the config file

```
php artisan vendor:publish --provider="MPesic381\Placeholders\PlaceholdersServiceProvider"
```

Usage
-----

[](#usage)

```
use Placeholders;

// Basic
Placeholders::parse("I like [fruit]s and [veg]s", [
	'fruit' => 'orange',
	'veg' => 'cucumber'
]); //I like oranges and cucumbers

// Globally
Placeholders::set("fruit", "apple");
Placeholders::set("veg", "carrot");
Placeholders::parse("I like [fruit]s and [veg]s"); // I like apples and carrots
```

### Style

[](#style)

```
// Change the style
Placeholders::setStyle("{{", "}}");
Placeholders::parse("I like {{fruit}}s and {{veg}}s", [
	'fruit' => 'lemon',
	'veg' => 'string bean'
]); //I like lemons and string beans
```

### Behaviors

[](#behaviors)

```
// Throw an error if one is missed
Placeholders::setBehavior('error')
Placeholders::parse("I like [fruit]s and [veg]s", [
	'fruit' => 'orange',
]); //Throws an Exception: Could not find a replacement for [veg]

// Delete the placeholder from the output if it is missing.
Placeholders::setBehavior('skip')
Placeholders::parse("I like [fruit]s and [veg]s", [
	'fruit' => 'orange',
]); // I like oranges and s

Placeholders::setBehavior('preserve')
Placeholders::parse("I like [fruit]s and [veg]s", [
	'fruit' => 'orange',
]); // I like oranges and [veg]s
```

### Changelog

[](#changelog)

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

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Credits
-------

[](#credits)

- [tylercd100](https://github.com/tylercd100) - This package is based on his one

License
-------

[](#license)

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

Laravel Package Boilerplate
---------------------------

[](#laravel-package-boilerplate)

This package was generated using the [Laravel Package Boilerplate](https://laravelpackageboilerplate.com).

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity57

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

Every ~274 days

Total

2

Last Release

765d ago

PHP version history (2 changes)1.0.0PHP ^7.4|^8.0

1.1.0PHP ^7.4|^8.0|^8.1|^8.2

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/15304658?v=4)[Miomir Pesic](/maintainers/MPesic381)[@MPesic381](https://github.com/MPesic381)

---

Top Contributors

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

---

Tags

mpesic381laravel-placeholders

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mpesic381-laravel-placeholders/health.svg)

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

###  Alternatives

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M687](/packages/barryvdh-laravel-ide-helper)[illuminate/pipeline

The Illuminate Pipeline package.

9446.6M213](/packages/illuminate-pipeline)[illuminate/pagination

The Illuminate Pagination package.

10532.5M862](/packages/illuminate-pagination)[spatie/laravel-pjax

A pjax middleware for Laravel 5

513371.8k11](/packages/spatie-laravel-pjax)[spatie/laravel-mix-preload

Add preload and prefetch links based your Mix manifest

169176.0k2](/packages/spatie-laravel-mix-preload)[illuminate/cookie

The Illuminate Cookie package.

224.3M122](/packages/illuminate-cookie)

PHPackages © 2026

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