PHPackages                             laravelhungary/announcement - 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. [Caching](/categories/caching)
4. /
5. laravelhungary/announcement

ActiveLibrary[Caching](/categories/caching)

laravelhungary/announcement
===========================

A simple way of announcements with Laravel

1.1.0(9y ago)174773[3 issues](https://github.com/laravelhungary/announcement/issues)[1 PRs](https://github.com/laravelhungary/announcement/pulls)MITPHP

Since Sep 9Pushed 7y ago2 watchersCompare

[ Source](https://github.com/laravelhungary/announcement)[ Packagist](https://packagist.org/packages/laravelhungary/announcement)[ Docs](http://hocza.com)[ RSS](/packages/laravelhungary-announcement/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (2)Dependencies (3)Versions (4)Used By (0)

[![Announcement](https://camo.githubusercontent.com/11b90c28f0e365c520097ec2d6c8e34bbf9795c9e7814845246e928d5441696f/687474703a2f2f64656d6f2e686f637a612e636f6d2f6769746875622f6c61726176656c2d616e6e6f756e63656d656e742f6c61726176656c2d616e6e6f756e63656d656e742e706e67)](https://camo.githubusercontent.com/11b90c28f0e365c520097ec2d6c8e34bbf9795c9e7814845246e928d5441696f/687474703a2f2f64656d6f2e686f637a612e636f6d2f6769746875622f6c61726176656c2d616e6e6f756e63656d656e742f6c61726176656c2d616e6e6f756e63656d656e742e706e67)

Laravel Announcement
====================

[](#laravel-announcement)

A package that simplifies the management of site-wide announcements. With "Laravel Announcement" you can display auto-expiring announcements.

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

[](#installation)

1- `composer require laravelhungary/announcement`

- plz note that the package use `predis/predis` for all of its operation.

2- Add the followings to `config/app.php`

```
'providers' => [
    ...

    LaravelHungary\Announcement\PackageServiceProvider::class,
],

'aliases' => [
    ...

    'Announce' => LaravelHungary\Announcement\Facades\Announce::class,
]
```

3- run `php artisan vendor:publish` and you will get

```
/config/announcement.php
/views/vendor/announcement/alert.blade.php
/Events/NewAnnouncement.php
/components/Announcement-bootstrap.vue
/components/Announcement-sweetalert.vue
```

4- That's it.

> if you need to broadcast the announcements through something like web-sockets please check [Event Broadcasting](https://laravel.com/docs/5.3/broadcasting)

Usage
-----

[](#usage)

### Normal

[](#normal)

#### Create Announcement

[](#create-announcement)

`Announce::create($title, $message, $type, $ttl);`

Params

- `title` a short message.

> For example: Breaking news!

- `message` A bit longer message.

> For example: Our servers are under a DDoS attack. We are trying hard to mitigate it.

- `type` Type of the announcement.

> For example: success,info,danger,warning (or anything you would like to use) , Default is: info

- `ttl` When should the announcement expire. \[Time to live\] in seconds.

> Default is: 60 seconds

#### Display of Announcements

[](#display-of-announcements)

put `{!! Announce::display() !!}` anywhere you want your announcement to be visible.

===

### Broadcasting

[](#broadcasting)

#### Create Announcement

[](#create-announcement-1)

`Announce::broadcast($title, $message, $type, $ttl, $transition, $channel_name);`

Params

- `title`,`message`,`type`,`ttl` same as the [normal](#normal) announcement
- `transition` what is animation type you want.

> For example: fade , bounce, etc... [Check Vue Transition](http://vuejs.org/guide/transitions.html#CSS-Transitions) , Default is: fade

- `channel_name` change it to override the config value "dont forget to also change it in the component file"

> Default is: public-announcement-channel

#### Display of Announcements

[](#display-of-announcements-1)

- note that the package doesnt care what driver you use `pusher` or `socket.io` , it will just work 🍺.
- we also use **VueJs 2**, but if you want to use something else then ignore the below and you are free to build your own.

1- put `Vue.component('my-announcement', require('./components/Announcement-bootstrap.vue'));` into your **app.js** file

2- put `` anywhere you want this announcement to show up. For example: your **layout.blade.php** file

> if you want to use something like `Animate.css` follow [Custom Transition Classes](https://vuejs.org/v2/guide/transitions.html#Custom-Transition-Classes)

Package Maintainers
-------------------

[](#package-maintainers)

- Jozsef Hocza [@hocza](https://github.com/hocza)
- Muah [@ctf0](https://github.com/ctf0)

Buy us a coffee :)
------------------

[](#buy-us-a-coffee-)

[![Click here to lend your support to: laravel-announcement and make a donation at pledgie.com !](https://camo.githubusercontent.com/d8cc917a7c4786d1e97fbd80fc00369aaacddb35aba7354e12d2649c25533ecb/68747470733a2f2f706c65646769652e636f6d2f63616d706169676e732f33323734382e706e673f736b696e5f6e616d653d6368726f6d65)](https://pledgie.com/campaigns/32748)

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance16

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 61.1% 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.

###  Release Activity

Cadence

Every ~88 days

Total

2

Last Release

3493d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/6116565?v=4)[Jozsef Hocza](/maintainers/hocza)[@hocza](https://github.com/hocza)

---

Top Contributors

[![hocza](https://avatars.githubusercontent.com/u/6116565?v=4)](https://github.com/hocza "hocza (11 commits)")[![ctf0](https://avatars.githubusercontent.com/u/7388088?v=4)](https://github.com/ctf0 "ctf0 (7 commits)")

---

Tags

laravelredis announcementhocza

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/laravelhungary-announcement/health.svg)

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

###  Alternatives

[spatie/laravel-responsecache

Speed up a Laravel application by caching the entire response

2.8k8.7M64](/packages/spatie-laravel-responsecache)[awssat/laravel-visits

Laravel Redis visits counter for Eloquent models

974169.8k2](/packages/awssat-laravel-visits)[encore/redis-manager

Redis manager for laravel

24943.1k](/packages/encore-redis-manager)[namoshek/laravel-redis-sentinel

An extension of Laravels Redis driver which supports connecting to a Redis master through Redis Sentinel.

39764.5k](/packages/namoshek-laravel-redis-sentinel)[yangusik/laravel-balanced-queue

Laravel queue management with load balancing between partitions (user groups)

8512.6k](/packages/yangusik-laravel-balanced-queue)[ginnerpeace/laravel-redis-lock

Simple redis distributed locks for Laravel.

15118.0k](/packages/ginnerpeace-laravel-redis-lock)

PHPackages © 2026

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