PHPackages                             hadefication/siren - 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. [API Development](/categories/api)
4. /
5. hadefication/siren

ActiveLibrary[API Development](/categories/api)

hadefication/siren
==================

v1.0.2(9y ago)015PHP

Since Apr 23Pushed 9y ago1 watchersCompare

[ Source](https://github.com/hadefication/siren)[ Packagist](https://packagist.org/packages/hadefication/siren)[ RSS](/packages/hadefication-siren/feed)WikiDiscussions master Synced today

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

Siren
=====

[](#siren)

Toast style application messages for Laravel using toastr.

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

[](#installation)

1. Install by running `composer require hadefication/siren`.
2. Add the service provider and facade to your `config/app.php`.

```
'providers' => [
    ...
    Hadefication\Siren\SirenServiceProvider::class,
    ...
],

'aliases' = [
    ...
    'Siren' => Hadefication\Siren\SirenFacade::class,
    ...
]

```

Usage
-----

[](#usage)

- To collect messages, you can either use the facade `Siren` or the nifty little helper function called `siren()`. This then will give you access to all of the methods that siren can offer. To collect an error message, use `siren()->error($message, $title, $important)` where `$message` will obviously the message you want to convey and same goes to `$title` then `$important` will determine if your message will stay until it's closed (set to `true`) or will auto-close after a number of seconds. See example below for the type of message that can be collected using siren.

```
// Example

$message = 'This is a message';
$title = 'Notification';
$important = false;

// Error
siren()->error($message, $title, $important);
// or
\Siren::error($message, $title, $important);

// Success
siren()->success($message, $title, $important);
// or
\Siren::success($message, $title, $important);

// Warning
siren()->warning($message, $title, $important);
// or
\Siren::warning($message, $title, $important);

// Notice or Info
siren()->notice($message, $title, $important);
// or
\Siren::notice($message, $title, $important);

```

- Next is you need to include the companion javascript library by either requiring it to your `app.js` or adding it directly to your view. You may need to copy `vendor/src/resources/assets/dist/siren.js` to your public path if your going for the later option. Luckily, Laravel Elixir or Laravel Mix can do that for you! Once the javascript library is added, you will then have `siren` global variable at your disposal, see **Javascript** section for more details.

```
// app.js
require('vendor/src/resources/assets/dist/siren.js');

// direct

```

- To show the toast messages, you need to add `siren()->render()` or `\Siren::render()` at the tail of your layout's view. It's important that this method will be the last one to be called.

```
    {!! siren()->render() !!}
    // or
    {!! \Siren::render() !!}

```

Javascript
----------

[](#javascript)

The companion javascript library uses this cool plugin called toastr to render the toast style message. Once the javascript library is referenced, then you will be able to access `siren` variable, this variable will then give you access to all methods that this library has to offer.

- `siren.setDefaults(options)` - will let you override the default settings of toastr. `options` param will be the overrides that you want.

```
// Overridable options
{
    closeButton: true,
    debug: false,
    newestOnTop: true,
    progressBar: true,
    positionClass: "toast-top-right",
    preventDuplicates: true,
    showDuration: 300,
    hideDuration: 1000,
    timeOut: 5000,
    extendedTimeOut: 1000,
    showEasing: "swing",
    hideEasing: "linear",
    showMethod: "fadeIn",
    hideMethod: "fadeOut"
}

// Example
// Override close button to be hidden
siren.setDefaults({
    closeButton: false,
})

```

- `siren.error(message, title, important, options)` - will show an error toast message. `message` will obviously the message to show and same goes to `title` then `important` will be the flag if you want the message to stay until closed or auto-closed after a period of time and finally the `options` param will give you the "option" to override the defaults of toastr. These will also be the same for other message types. See example below for more details.

```
// Error
// Will show close button to the toast message and will show the toast for 10 second
siren.error('This is a test', 'Error', false, {closeButton: true, timeOut: 10000});

// Success
siren.success('This is a success message', 'Success');

// Warning
siren.warning('Warning message here', 'Warning!');

// Notice
siren.success('A notice message here', 'Notification', true);

```

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity65

Established project with proven stability

 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.

###  Release Activity

Cadence

Every ~0 days

Total

3

Last Release

3354d ago

### Community

Maintainers

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

---

Top Contributors

[![hadefication](https://avatars.githubusercontent.com/u/6673244?v=4)](https://github.com/hadefication "hadefication (13 commits)")

### Embed Badge

![Health badge](/badges/hadefication-siren/health.svg)

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

###  Alternatives

[defstudio/telegraph

A laravel facade to interact with Telegram Bots

815320.5k3](/packages/defstudio-telegraph)[riclep/laravel-storyblok

A Laravel wrapper around the Storyblok API to provide a familiar experience for Laravel devs

6277.0k5](/packages/riclep-laravel-storyblok)[jasara/php-amzn-selling-partner-api

A fluent interface for Amazon's Selling Partner API in PHP

1348.1k1](/packages/jasara-php-amzn-selling-partner-api)[rapidez/core

Rapidez Core

1822.4k65](/packages/rapidez-core)

PHPackages © 2026

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