PHPackages                             ps24love/widget - 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. [Framework](/categories/framework)
4. /
5. ps24love/widget

ActiveLibrary[Framework](/categories/framework)

ps24love/widget
===============

laravel4 widget system

311[2 issues](https://github.com/ps24love/widget/issues)PHP

Since May 19Pushed 12y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

Simple Widget System - Laravel 4.\*
===================================

[](#simple-widget-system---laravel-4)

Simple widget system for create awesome feature on blade templating Laravel 4

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

[](#installation)

Open your composer.json file, and add the new required package.

```
  "Ps24love/widget": "dev-master"

```

Next, open a terminal and run.

```
  composer update

```

After the composer updated. Add new service provider and alias in app/config/app.php.

```
  'Ps24love\Widget\WidgetServiceProvider'

```

```
  'Widget' => 'Ps24love\Widget\Facades\Widget'

```

Done.

Example
-------

[](#example)

### Registering your widget

[](#registering-your-widget)

To register your widget, simply create a file `widgets.php` in your `app` folder and put your widgets code in that file. Like this.

```
laravel/
|-- app/
	|-- commands/
	...
	|-- views/
	|-- filters.php
	|-- routes.php
	|-- widgets.php
|-- bootstrap/
|-- vendor/

```

Simple Widget :

```
Widget::register('awesome', function(){

	return View::make('awesome');

});
```

Widgets with one or more parameters:

```
Widget::register('hello', function($name){

	return "Hello, $name !";

});

Widget::register('box', function($title, $description){

	return View::make('widgets.box', compact('title', 'description'));

});
```

Widget grouping of widgets that have previously been defined.

```
// First, you must registering one or more widget

Widget::register('categories', function(){
	return View::make('widgets.categories');
});

Widget::register('latestPost', function(){
	return View::make('widgets.latestPost');
});

// Next, you can group some widgets like this:

Widget::group('sidebar', array('categories', 'latestPost'));

Widget::group('footer', array('hello', 'box'));
```

### Calling your widget

[](#calling-your-widget)

Globally calling the widget just like below:

```
Widget::awesome();

Widget::hello('John');

Widget::box('Latest News', 'This is a description of latest news');

// calling widget group just like below
// Widget::$name();
Widget::sidebar();

// calling widget group which parameters just like below
// Widget::$name($params1, $params2, $params3, ....);
Widget::box(array('name'), array('My Tweets', '.....Latest Tweets'));
```

simple calling widget on view :

```
@awesome

@hello('John')

//calling group widget

@sidebar()

@box(array('name'), array('My Tweets', '.....Latest Tweets'))
```

License
-------

[](#license)

This package is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT)

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance7

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/cee9a5da874e8d6a72eb20909adbdd96834e0fd8cfbe8ce5140b3cd91be116fb?d=identicon)[ps24love](/maintainers/ps24love)

---

Top Contributors

[![ps24love](https://avatars.githubusercontent.com/u/1007823?v=4)](https://github.com/ps24love "ps24love (7 commits)")

### Embed Badge

![Health badge](/badges/ps24love-widget/health.svg)

```
[![Health](https://phpackages.com/badges/ps24love-widget/health.svg)](https://phpackages.com/packages/ps24love-widget)
```

###  Alternatives

[laravel/telescope

An elegant debug assistant for the Laravel framework.

5.2k67.8M192](/packages/laravel-telescope)[spiral/roadrunner

RoadRunner: High-performance PHP application server and process manager written in Go and powered with plugins

8.4k12.2M84](/packages/spiral-roadrunner)[nolimits4web/swiper

Most modern mobile touch slider and framework with hardware accelerated transitions

41.8k177.2k1](/packages/nolimits4web-swiper)[laravel/dusk

Laravel Dusk provides simple end-to-end testing and browser automation.

1.9k36.7M259](/packages/laravel-dusk)[laravel/prompts

Add beautiful and user-friendly forms to your command-line applications.

708181.8M596](/packages/laravel-prompts)[cakephp/chronos

A simple API extension for DateTime.

1.4k47.7M121](/packages/cakephp-chronos)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
