2017 © Pedro Peláez
 

library laravelmacros

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

image

lucasvdh/laravelmacros

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

  • Wednesday, July 12, 2017
  • by lucasvdh
  • Repository
  • 1 Watchers
  • 2 Stars
  • 922 Installations
  • CSS
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 10 % Grown

The README.md

Laravel 5 Macros

A useful set of HTML and Form macros with corresponding CSS and Javascript resources. Made for Bootstrap., (*1)

Check out the 4.0 branch for Laravel 4 support., (*2)

Getting started

  1. Include the package in your application
  2. Register the service provider
  3. Publish and include the styles and scripts

View the examples., (*3)

Include the package in your application

``` bash composer require lucasvdh/laravelmacros:5.*, (*4)

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

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

Register the service provider

Edit the config/app.php file. Append the following to the providers array:, (*5)

``` php 'providers' => [ // ... Lucasvdh\LaravelMacros\MacroServiceProvider::class, // ... ],, (*6)


If you didn't have the `laravelcollective/html` package yet, be sure to add that service provider too: ``` php 'providers' => [ // ... Collective\Html\HtmlServiceProvider::class, // ... ],

And register the aliases:, (*7)

``` php 'aliases' => [ // ... 'Form' => Collective\Html\FormFacade::class, 'Html' => Collective\Html\HtmlFacade::class, // ... ],, (*8)



## Publish and include the styles and scripts ``` bash $ php artisan vendor:publish --provider="Lucasvdh\LaravelMacros\MacroServiceProvider"

Publishing a specific resource

``` bash $ 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", (*9)


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 Either you include all the plugins as a minified file. ``` html <html> <head> ... <link href="/css/laravel-macros.css" rel="stylesheet"> </head> <body> ... <!-- Include Javascript at the end of body to improve page load speed --> <script src="/js/laravel-macros.js" type="text/javascript"></script> </body> </html>

Include specific plugins

Or you include specific plugins., (*10)

``` html , (*11)

... ...
    <!-- IMPORTANT this file is required for the plugins to function -->
    <script src="/js/laravel-macros-app.js" type="text/javascript"></script>
</body>

, (*12)


# That's 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 Date picker ``` blade {!! Form::datepicker('field_name', $default, ['class' => 'some-class']) !!}

datepicker, (*13)

datepicker-extended, (*14)

Chosen select, (*15)

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


![chosen](http://download-manager.nl/lucasvdh/laravelmacros/chosen-select.png "Chosen select") ![chosen-extended](http://download-manager.nl/lucasvdh/laravelmacros/chosen-select-extended.png "Chosen select extended") Material checkbox ``` blade {!! Form::materialCheckbox('field_name', $checked, 'This is the checkbox text', 'value', ['class' => 'some-class']) !!}

material-checkbox, (*17)

material-checkbox-checked, (*18)

Material radio, (*19)

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

material-radio, (*21)

The Versions

12/07 2017

5.3.x-dev

5.3.9999999.9999999-dev https://github.com/lucasvdh/laravelmacros

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

  Sources   Download

MIT

The Requires

 

laravel css form javascript html js macros set macro styling

12/07 2017

dev-master

9999999-dev https://github.com/lucasvdh/laravelmacros

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

  Sources   Download

MIT

The Requires

 

laravel css form javascript html js macros set macro styling

27/02 2017

5.3

5.3.0.0 https://github.com/lucasvdh/laravelmacros

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

  Sources   Download

MIT

The Requires

 

laravel css form javascript html js macros set macro styling

19/10 2016

5.0.x-dev

5.0.9999999.9999999-dev https://github.com/lucasvdh/laravelmacros

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

  Sources   Download

MIT

The Requires

 

laravel css form javascript html js macros set macro styling