PHPackages                             wuwx/laravel-widgets - 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. wuwx/laravel-widgets

ActiveLibrary

wuwx/laravel-widgets
====================

A powerful alternative to view composers. Asynchronous widgets, reloadable widgets, console generator, caching - everything you can think of.

3.13.0(7y ago)18MITPHPPHP &gt;=7.0

Since Jan 11Pushed 6y ago1 watchersCompare

[ Source](https://github.com/wuwx/laravel-widgets)[ Packagist](https://packagist.org/packages/wuwx/laravel-widgets)[ Docs](https://github.com/arrilot/laravel-widgets)[ RSS](/packages/wuwx-laravel-widgets/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (7)Versions (70)Used By (0)

[![Latest Stable Version](https://camo.githubusercontent.com/0d58426a432a8182bcbe3d19058a2dd94c05d6ffc2673f299fcff030307ad0d0/68747470733a2f2f706f7365722e707567782e6f72672f777577782f6c61726176656c2d776964676574732f762f737461626c652e737667)](https://packagist.org/packages/wuwx/laravel-widgets/)[![Total Downloads](https://camo.githubusercontent.com/1645b6d9f80763ede8d307b205f067260667ce7f39a0eedaa15ded2727459647/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f777577782f6c61726176656c2d776964676574732e737667)](https://packagist.org/packages/wuwx/laravel-widgets)[![Build Status](https://camo.githubusercontent.com/0dc8f1c916bcdaa248984a9c576ae9c743f8347249bf7512049762ab46b2e803/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f777577782f6c61726176656c2d776964676574732f6d61737465722e737667)](https://travis-ci.org/wuwx/laravel-widgets)[![Scrutinizer Quality Score](https://camo.githubusercontent.com/895958503478b91364fa59fcab5e8d55098995f313f9c55aa6e207ac1d75aa62/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f777577782f6c61726176656c2d776964676574732f6d61737465722e737667)](https://scrutinizer-ci.com/g/wuwx/laravel-widgets/)

Widgets for Laravel
===================

[](#widgets-for-laravel)

*A powerful alternative to view composers. Asynchronous widgets, reloadable widgets, console generator, caching - everything that you can imagine.*

Installation
------------

[](#installation)

Run `composer require wuwx/laravel-widgets:dev-master`

Laravel &gt;=5.5 uses Package Auto-Discovery, so you don't need to manually add the ServiceProvider and Facades

Usage
-----

[](#usage)

Let's consider that we want to make a list of recent news and reuse it in several views.

First of all we can create a Widget class using the artisan command provided by the package.

```
php artisan make:widget RecentNews
```

This command generates two files:

1. `resources/views/widgets/recent_news.blade.php` is an empty view.

Add "--plain" option if you do not need a view.

2. `app/Widgets/RecentNews` is a widget class.

```
