PHPackages                             rtler/blademacro - 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. [Templating &amp; Views](/categories/templating)
4. /
5. rtler/blademacro

ActiveLibrary[Templating &amp; Views](/categories/templating)

rtler/blademacro
================

add macro to blade laravel

210PHP

Since Aug 17Pushed 10y ago1 watchersCompare

[ Source](https://github.com/RTLer/bladeMacro)[ Packagist](https://packagist.org/packages/rtler/blademacro)[ RSS](/packages/rtler-blademacro/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

bladeMacro
==========

[](#blademacro)

macro extension for laravel blade. it add macros to laravel blade that work just like html macro but there is problem with html macro that it register and echo function into compiled view code and run functin every time page loads, but this library run fubction and echo return into compiled view.

\##installation add this to your providers

```
    'providers' => [
		...
        RTLer\BladeMacro\BladeMacroServiceProvider::class
		...
    ],
```

\##usage and register macroes using(for adding php code to view write it in string)

```
      BladeMacro::macro('inputText', function ($arg1, $arg2, $arg3, $arg4) {
          return 'testing ' . $arg1 . ' ' . $arg2 . ' ' . $arg3 . ' ' . $arg4;
      });
```

\*it can contains php code in return string

and in view use it like this (macroName(arg1, arg2, ...)):

```
    @macroInputText('name', 'value', 'label', 'options')
```

and becuse of that this code replase the return string of the BladeMacro::macro function and cache it, after changeing the macro run the command

```
php artisan view:clear

```

\##contribute i add Illuminate\\Html to it (htmlName(arg1, arg2, ...),formName(arg1, arg2, ...)) but there is problem with form if you like to help fix form.

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

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://avatars.githubusercontent.com/u/223000469?v=4)[RTLer](/maintainers/RTLer)[@rtler](https://github.com/rtler)

---

Top Contributors

[![hoomanna](https://avatars.githubusercontent.com/u/5413073?v=4)](https://github.com/hoomanna "hoomanna (10 commits)")

### Embed Badge

![Health badge](/badges/rtler-blademacro/health.svg)

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

###  Alternatives

[limenius/react-bundle

Client and Server-side react rendering in a Symfony Bundle

3851.2M](/packages/limenius-react-bundle)[area17/laravel-auto-head-tags

Laravel Auto Head Tags helps you build the list of head elements for your app

4616.1k](/packages/area17-laravel-auto-head-tags)[jelix/wikirenderer

WikiRenderer is a library to generate HTML or anything else from wiki content.

1712.3k1](/packages/jelix-wikirenderer)[webkinder/sproutset

A Composer package for handling responsive images in Roots Bedrock + Sage + Blade projects.

282.2k](/packages/webkinder-sproutset)

PHPackages © 2026

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