Download the PHP package chargefield/laravel-widget without Composer
On this page you can find all versions of the php package chargefield/laravel-widget. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download chargefield/laravel-widget
More information about chargefield/laravel-widget
Files in chargefield/laravel-widget
Package laravel-widget
Short Description Widget based approach for structuring portions of your views.
License MIT
Informations about the package laravel-widget
Laravel Widget
Laravel Widget is a class based approach for structuring portions of your views.
Installation
You can install the package via composer:
Usage
Artisan Command
or
This will generate the following files:
app/Http/Widgets/ExampleWidget.php
resources/views/widgets/example-widget.blade.php
Blade Directive
Including a widget is as easy as using the @widget
blade directive:
You can pass external data to the widget as an array to the second argument. It will be available in both the class and view:
Widget Data
All public properties and public methods are passed down to the view as their respected names.
Example
Widget Class:
Widget Blade View:
Output:
Testing
You can run the tests with:
Changelog
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
Credits
- Clayton D'Mello
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
All versions of laravel-widget with dependencies
illuminate/console Version ^6.0|^7.0
illuminate/support Version ^6.0|^7.0