Jozsef Hocza

Sendy API for Laravel

Announcement Check it out at Github

Laravel Announcement

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

To achieve this the package simply uses the Redis’s TTL.

Installation

1- composer require laravelhungary/announcement

2- Add the followings to config/app.php

<?php

'providers' => [
    ...

    LaravelHungary\Announcement\PackageServiceProvider::class,
],

'aliases' => [
    ...

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

3- That’s it.

Usage

Create Announcement

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

Params

Display of Announcements

{!! Announce::display() !!}

If you would like to override the default bootstrap alerts, feel free to create your own in resources/views/vendor/announcement/alert.blade.php

example:

@foreach($announcements as $announcement)
    <div class="alert alert-{{ $announcement->type }} alert-dismissible">
        <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <strong>{{ $announcement->title }}</strong> {{ $announcement->message }}
    </div>
@endforeach

Package dependencies

“predis/predis”

Package Maintainers

Buy us a coffee :)

Click here to lend your support to: laravel-announcement and make a donation at pledgie.com !

SUBSCRIBE
Subscribe to my e-mail list.
You can unsubscribe anytime.