PHPackages                             nahidulhasan/laravel-macros - 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. nahidulhasan/laravel-macros

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

nahidulhasan/laravel-macros
===========================

A Simple package for using Macros in Laravel

1.0.2(7y ago)9961MITPHP

Since Oct 14Pushed 7y ago1 watchersCompare

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

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

Laravel-Macros
==============

[](#laravel-macros)

[![Latest Stable Version](https://camo.githubusercontent.com/b874a4c37590d43f65cc6ac9909dd56e661a6ba2e1a79900338f5449477c19b2/68747470733a2f2f706f7365722e707567782e6f72672f6e61686964756c686173616e2f6c61726176656c2d6d6163726f732f762f737461626c65)](https://packagist.org/packages/nahidulhasan/laravel-macros)[![Total Downloads](https://camo.githubusercontent.com/60f2b96cd76884d0a9aca8623a072f4888d97ab699d55dfa800a80a4b16ed8f7/68747470733a2f2f706f7365722e707567782e6f72672f6e61686964756c686173616e2f6c61726176656c2d6d6163726f732f646f776e6c6f616473)](https://packagist.org/packages/nahidulhasan/laravel-macros)[![Latest Unstable Version](https://camo.githubusercontent.com/c411da64883aec7be0181af0ef12f68468fb313b12dc09a14d8fa2072a76fabe/68747470733a2f2f706f7365722e707567782e6f72672f6e61686964756c686173616e2f6c61726176656c2d6d6163726f732f762f756e737461626c65)](https://packagist.org/packages/nahidulhasan/laravel-macros)[![License](https://camo.githubusercontent.com/e0b868872fe6458e8e50f465345b715cd447a30c9e8be7dea8763bd0ffa656a2/68747470733a2f2f706f7365722e707567782e6f72672f6e61686964756c686173616e2f6c61726176656c2d6d6163726f732f6c6963656e7365)](https://packagist.org/packages/nahidulhasan/laravel-macros)

> A Simple package for using Macros in Laravel

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

[](#installation)

### Requirements

[](#requirements)

- PHP &gt;= 5.6.4
- Laravel &gt;= 5.5

### Installing

[](#installing)

Run the following commands

```
composer require nahidulhasan/laravel-macros

php artisan vendor:publish
```

Basic Usage
-----------

[](#basic-usage)

A new class is created in **App/Services** folder named **Macros.php**. Here you have to add your code.

For example, I have added bank list.

Now you can call **Form::selectBank()** in any view, and have it display a nice list of Bank list to select from.

You can specify the parameters as the **input name**, **default selected value**, and **array of options**.

Here is the example :

```

Bank Name

{{ Form::selectBank("bank_name", $merchant['paymentInfo']->bank_name ?? null,["class"=>"form-control"]) }}

```

If you want to learn more about macros and want to configure without using package, please read this [blog](https://medium.com/@NahidulHasan/how-to-use-macros-in-laravel-a9078a0610f9)

### License

[](#license)

Laravel-Macros for Laravel is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT)

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity63

Established project with proven stability

 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 ~0 days

Total

2

Last Release

2767d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/3033344?v=4)[Nahidul Hasan](/maintainers/nahidulhasan)[@nahidulhasan](https://github.com/nahidulhasan)

---

Top Contributors

[![nahidulhasan](https://avatars.githubusercontent.com/u/3033344?v=4)](https://github.com/nahidulhasan "nahidulhasan (16 commits)")

---

Tags

laravelmacros

### Embed Badge

![Health badge](/badges/nahidulhasan-laravel-macros/health.svg)

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

###  Alternatives

[patricktalmadge/bootstrapper

Twitter Bootstrap markup generator

557407.2k4](/packages/patricktalmadge-bootstrapper)[nwidart/laravel-menus

Laravel Menu management

168180.3k10](/packages/nwidart-laravel-menus)[pingpong/menus

Laravel Menus

70194.4k13](/packages/pingpong-menus)[akaunting/laravel-menu

Menu and sidebar management package for Laravel

38233.8k](/packages/akaunting-laravel-menu)[caouecs/sirtrevorjs

Sir Trevor JS in Laravel project

5421.6k](/packages/caouecs-sirtrevorjs)[rinvex/laravel-menus

Rinvex Menus is a simple menu builder package for Laravel, that supports hierarchical structure, ordering, and styling with full flexibility using presenters for easy styling and custom structure of menu rendering.

294.0k20](/packages/rinvex-laravel-menus)

PHPackages © 2026

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