Recommend this page to a friend! |
![]() ![]() |
Info | ![]() |
![]() |
![]() ![]() |
Reputation | Support forum | Blog (1) | Links |
Last Updated | Ratings | Unique User Downloads | Download Rankings | |||||
2022-09-07 (23 days ago) ![]() | Not yet rated by the users | Total: 23 This week: 9 | All time: 10,706 This week: 16![]() |
Version | License | PHP version | Categories | |||
laravel-macros 1.0 | The PHP License | 5 | PHP 5, Libraries, Templates, Design P... |
Description | Author | |||
This package provides an example of a macro service in view templates. Innovation Award
|
|
> A Simple package for using Macros in Laravel
- PHP >= 5.6.4 - Laravel >= 5.5
Run the following commands
composer require nahidulhasan/laravel-macros
php artisan vendor:publish
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 :
<div class="form-group">
<label for="bank_name">Bank Name</label>
{{ Form::selectBank("bank_name", $merchant['paymentInfo']->bank_name ?? null,["class"=>"form-control"]) }}
</div>
If you want to learn more about macros and want to configure without using package, please read this blog
Laravel-Macros for Laravel is open-sourced software licensed under the MIT license
![]() |
File | Role | Description | ||
---|---|---|---|---|
![]() |
||||
![]() ![]() |
Data | Auxiliary data | ||
![]() ![]() |
Data | Auxiliary data | ||
![]() ![]() |
Doc. | Documentation |
Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
100% |
|
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.