PHPackages                             arrilot/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. [Templating &amp; Views](/categories/templating)
4. /
5. arrilot/laravel-widgets

ActiveLibrary[Templating &amp; Views](/categories/templating)

arrilot/laravel-widgets
=======================

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

3.15.0(4mo ago)1.1k4.6M—1.6%110[1 issues](https://github.com/arrilot/laravel-widgets/issues)[2 PRs](https://github.com/arrilot/laravel-widgets/pulls)20MITPHPPHP &gt;=8.2CI failing

Since Jan 11Pushed 2mo ago48 watchersCompare

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

READMEChangelog (10)Dependencies (9)Versions (79)Used By (20)

[![Latest Stable Version](https://camo.githubusercontent.com/688173ef7ccc0785537950b32067ebf604facd60f9909f5d8f564c55be503b4e/68747470733a2f2f706f7365722e707567782e6f72672f617272696c6f742f6c61726176656c2d776964676574732f762f737461626c652e737667)](https://packagist.org/packages/arrilot/laravel-widgets/)[![Total Downloads](https://camo.githubusercontent.com/37a5f78839f5e4b6e4e2432be193ffab7d774b2b298f635886da3483f3cb2a51/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f617272696c6f742f6c61726176656c2d776964676574732e737667)](https://packagist.org/packages/arrilot/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 arrilot/laravel-widgets`

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.

```
