Recommend this page to a friend! |
Classes of Nahidul Hasan | Laravel Macro Example | README.md | Download |
|
DownloadLaravel-Macros> A Simple package for using Macros in Laravel InstallationRequirements- PHP >= 5.6.4 - Laravel >= 5.5 InstallingRun the following commands
Basic UsageA 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 :
If you want to learn more about macros and want to configure without using package, please read this blog LicenseLaravel-Macros for Laravel is open-sourced software licensed under the MIT license |