PHPackages                             lucasvdh/laravelmacros - 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. lucasvdh/laravelmacros

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

lucasvdh/laravelmacros
======================

A useful set of HTML and Form macros with css and js made for bootstrap

5.3(9y ago)21.7kMITCSSPHP &gt;=5.3.0

Since Oct 19Pushed 8y ago1 watchersCompare

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

READMEChangelogDependencies (2)Versions (4)Used By (0)

Laravel 5 Macros
================

[](#laravel-5-macros)

A useful set of HTML and Form macros with corresponding CSS and Javascript resources. Made for Bootstrap.

Check out the 4.0 branch for Laravel 4 support.

Getting started
---------------

[](#getting-started)

1. [Include the package in your application](#include-the-package-in-your-application)
2. [Register the service provider](#register-the-service-provider)
3. [Publish and include the styles and scripts](#publish-and-include-the-styles-and-scripts)

View the [examples](#examples).

Include the package in your application
---------------------------------------

[](#include-the-package-in-your-application)

```
composer require lucasvdh/laravelmacros:5.*
```

Or add a requirement to your project's composer.json

```
    "require": {
        "lucasvdh/laravelmacros": "5.*"
    },
```

Register the service provider
-----------------------------

[](#register-the-service-provider)

Edit the `config/app.php` file. Append the following to the `providers` array:

```
  'providers' => [
    // ...
    Lucasvdh\LaravelMacros\MacroServiceProvider::class,
    // ...
  ],
```

If you didn't have the `laravelcollective/html` package yet, be sure to add that service provider too:

```
  'providers' => [
    // ...
    Collective\Html\HtmlServiceProvider::class,
    // ...
  ],
```

And register the aliases:

```
 'aliases' => [
    // ...
    'Form' => Collective\Html\FormFacade::class,
    'Html' => Collective\Html\HtmlFacade::class,
    // ...
  ],
```

Publish and include the styles and scripts
------------------------------------------

[](#publish-and-include-the-styles-and-scripts)

```
$ php artisan vendor:publish --provider="Lucasvdh\LaravelMacros\MacroServiceProvider"
```

#### Publishing a specific resource

[](#publishing-a-specific-resource)

```
$ php artisan vendor:publish --provider="Lucasvdh\LaravelMacros\MacroServiceProvider" --tag="scripts"
$ php artisan vendor:publish --provider="Lucasvdh\LaravelMacros\MacroServiceProvider" --tag="styles"
$ php artisan vendor:publish --provider="Lucasvdh\LaravelMacros\MacroServiceProvider" --tag="images"
```

The CSS and Javascript files will be published to `public/css` and `public/js`.

Make sure to include these in the view where you want to use the macros. You have two choices for including the styles and scripts.

### Include all

[](#include-all)

Either you include all the plugins as a minified file.

```

        ...

        ...

```

### Include specific plugins

[](#include-specific-plugins)

Or you include specific plugins.

```

        ...

        ...

```

That's it
=========

[](#thats-it)

You can now use the macros and all should work. Customization of the CSS and Javascript files should be straight forward.

Below, a few examples are given how to use these macros:

Examples
--------

[](#examples)

Date picker

```
{!! Form::datepicker('field_name', $default, ['class' => 'some-class']) !!}
```

[![datepicker](https://camo.githubusercontent.com/fa0e2734757c8740623a26b3b711350b63d9c074dda6d9408e2e117eae4cad62/687474703a2f2f646f776e6c6f61642d6d616e616765722e6e6c2f6c756361737664682f6c61726176656c6d6163726f732f646174657069636b65722e706e67 "Date picker")](https://camo.githubusercontent.com/fa0e2734757c8740623a26b3b711350b63d9c074dda6d9408e2e117eae4cad62/687474703a2f2f646f776e6c6f61642d6d616e616765722e6e6c2f6c756361737664682f6c61726176656c6d6163726f732f646174657069636b65722e706e67)

[![datepicker-extended](https://camo.githubusercontent.com/33913ebd08b4e75243fd285bb207005baf9a5d50b57a639f4fef752f2dc6e092/687474703a2f2f646f776e6c6f61642d6d616e616765722e6e6c2f6c756361737664682f6c61726176656c6d6163726f732f646174657069636b65722d657874656e6465642e706e67 "Date picker extended")](https://camo.githubusercontent.com/33913ebd08b4e75243fd285bb207005baf9a5d50b57a639f4fef752f2dc6e092/687474703a2f2f646f776e6c6f61642d6d616e616765722e6e6c2f6c756361737664682f6c61726176656c6d6163726f732f646174657069636b65722d657874656e6465642e706e67)

Chosen select

```
{!! Form::chosen('field_name', $default, $list, ['class' => 'some-class']) !!}
```

[![chosen](https://camo.githubusercontent.com/53a8cea61d38eca13ec8e4ffcca13f07d32f832903268a178ecdfcdae7be99ff/687474703a2f2f646f776e6c6f61642d6d616e616765722e6e6c2f6c756361737664682f6c61726176656c6d6163726f732f63686f73656e2d73656c6563742e706e67 "Chosen select")](https://camo.githubusercontent.com/53a8cea61d38eca13ec8e4ffcca13f07d32f832903268a178ecdfcdae7be99ff/687474703a2f2f646f776e6c6f61642d6d616e616765722e6e6c2f6c756361737664682f6c61726176656c6d6163726f732f63686f73656e2d73656c6563742e706e67)

[![chosen-extended](https://camo.githubusercontent.com/366cde843dc9e198660018d1578b8b82c83e12da2b808fc918e6595779ef3668/687474703a2f2f646f776e6c6f61642d6d616e616765722e6e6c2f6c756361737664682f6c61726176656c6d6163726f732f63686f73656e2d73656c6563742d657874656e6465642e706e67 "Chosen select extended")](https://camo.githubusercontent.com/366cde843dc9e198660018d1578b8b82c83e12da2b808fc918e6595779ef3668/687474703a2f2f646f776e6c6f61642d6d616e616765722e6e6c2f6c756361737664682f6c61726176656c6d6163726f732f63686f73656e2d73656c6563742d657874656e6465642e706e67)

Material checkbox

```
{!! Form::materialCheckbox('field_name', $checked, 'This is the checkbox text', 'value', ['class' => 'some-class']) !!}
```

[![material-checkbox](https://camo.githubusercontent.com/55c343f9ff84a95559469d7f766a8efe220d45ddfd011a036498d941055575b3/687474703a2f2f646f776e6c6f61642d6d616e616765722e6e6c2f6c756361737664682f6c61726176656c6d6163726f732f6d6174657269616c2d636865636b626f782e706e67 "Material checkbox")](https://camo.githubusercontent.com/55c343f9ff84a95559469d7f766a8efe220d45ddfd011a036498d941055575b3/687474703a2f2f646f776e6c6f61642d6d616e616765722e6e6c2f6c756361737664682f6c61726176656c6d6163726f732f6d6174657269616c2d636865636b626f782e706e67)

[![material-checkbox-checked](https://camo.githubusercontent.com/d76c2e149001a44b2105ed0771b9f0671bad2eefae1fe2f17dfdbf7fc52e43e3/687474703a2f2f646f776e6c6f61642d6d616e616765722e6e6c2f6c756361737664682f6c61726176656c6d6163726f732f6d6174657269616c2d636865636b626f782d636865636b65642e706e67 "Material checkbox checked")](https://camo.githubusercontent.com/d76c2e149001a44b2105ed0771b9f0671bad2eefae1fe2f17dfdbf7fc52e43e3/687474703a2f2f646f776e6c6f61642d6d616e616765722e6e6c2f6c756361737664682f6c61726176656c6d6163726f732f6d6174657269616c2d636865636b626f782d636865636b65642e706e67)

Material radio

```
{!! Form::materialRadio('field_name', $default, $options = ['value' => 'label'], ['class' => 'some-class']) !!}
```

[![material-radio](https://camo.githubusercontent.com/74e62fa5b95bb5844c3c76a941da4069dc5c6ec7fb409aac7b1dd7aa11182dc8/687474703a2f2f646f776e6c6f61642d6d616e616765722e6e6c2f6c756361737664682f6c61726176656c6d6163726f732f6d6174657269616c2d726164696f2e706e67 "Material radio")](https://camo.githubusercontent.com/74e62fa5b95bb5844c3c76a941da4069dc5c6ec7fb409aac7b1dd7aa11182dc8/687474703a2f2f646f776e6c6f61642d6d616e616765722e6e6c2f6c756361737664682f6c61726176656c6d6163726f732f6d6174657269616c2d726164696f2e706e67)

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity60

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

Total

3

Last Release

3227d ago

PHP version history (2 changes)5.0.x-devPHP &gt;=5.3.0

5.3.x-devPHP &gt;=5.6.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/276ac615994962c132eb8c6af822850eecf36cf6482969c673fe0d95a1266a9d?d=identicon)[lucasvdh](/maintainers/lucasvdh)

---

Top Contributors

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

---

Tags

laraveljavascriptcssJShtmlsetformmacrostylingmacros

### Embed Badge

![Health badge](/badges/lucasvdh-laravelmacros/health.svg)

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

###  Alternatives

[matthiasmullie/minify

CSS &amp; JavaScript minifier, in PHP. Removes whitespace, strips comments, combines files (incl. @import statements and small assets in CSS files), and optimizes/shortens a few common programming patterns.

2.0k30.5M336](/packages/matthiasmullie-minify)[stolz/assets

An ultra-simple-to-use assets management library

296519.2k8](/packages/stolz-assets)[yajra/laravel-datatables-html

Laravel DataTables HTML builder plugin

2899.6M48](/packages/yajra-laravel-datatables-html)[efficiently/larasset

Larasset is a library for Laravel 5 which manage assets in an easy way.

684.8k](/packages/efficiently-larasset)[okipa/laravel-form-components

Ready-to-use and customizable form components.

198.0k1](/packages/okipa-laravel-form-components)[bissolli/php-css-js-minifier

A PHP Class to merge and minify CSS and JavaScript files.

102.8k4](/packages/bissolli-php-css-js-minifier)

PHPackages © 2026

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