PHPackages                             amjadiqbal/alertify - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. amjadiqbal/alertify

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

amjadiqbal/alertify
===================

A BEAUTIFUL, RESPONSIVE, CUSTOMIZABLE, ACCESSIBLE (WAI-ARIA) REPLACEMENT FOR JAVASCRIPT'S POPUP BOXES , AVAILABLE FOR LARAVEL PROJECTS.

00JavaScriptCI failing

Since Jul 17Pushed 10mo ago1 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

Alertify for Laravel
====================

[](#alertify-for-laravel)

A beautiful, responsive, customizable, accessible (WAI-ARIA) replacement for JavaScript's popup boxes, available for Laravel projects.

[![Latest Stable Version](https://camo.githubusercontent.com/872df0472c8a376bd2f382abb1492b727252c22aecd40dce74ecdf5a5f70f72b/68747470733a2f2f706f7365722e707567782e6f72672f616d6a6164697162616c2f616c6572746966792f762f737461626c65)](https://packagist.org/packages/amjadiqbal/alertify)[![Total Downloads](https://camo.githubusercontent.com/ca60ac32f9efa142c367112d8e659b6ce09f2667e07c024a789268409203e9c6/68747470733a2f2f706f7365722e707567782e6f72672f616d6a6164697162616c2f616c6572746966792f646f776e6c6f616473)](https://packagist.org/packages/amjadiqbal/alertify)[![License](https://camo.githubusercontent.com/6efaf25ab2635673799fa6087477ab1b1b7b97ebcbbafbda0fe8fc2015d71c6b/68747470733a2f2f706f7365722e707567782e6f72672f616d6a6164697162616c2f616c6572746966792f6c6963656e7365)](https://packagist.org/packages/amjadiqbal/alertify)

Introduction
------------

[](#introduction)

Alertify is a Laravel package that integrates the AlertifyJS library to provide beautiful, customizable alert and notification boxes for your Laravel applications. It offers a simple and elegant way to replace JavaScript's default popup boxes with more stylish and functional alternatives.

Features
--------

[](#features)

- Beautiful, responsive alert dialogs
- Toast notifications
- Customizable themes and styles
- WAI-ARIA accessibility support
- Simple integration with Laravel
- Middleware support for automatic alerts
- Session-based alert management

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

[](#installation)

### Step 1: Install the package via Composer

[](#step-1-install-the-package-via-composer)

```
composer require amjadiqbal/alertify
```

### Step 2: Register the Service Provider (Laravel 5.4 or below)

[](#step-2-register-the-service-provider-laravel-54-or-below)

For Laravel 5.5 and above, the package will be auto-discovered. For older versions, add the service provider to your `config/app.php` file:

```
'providers' => [
    // ...
    AmjadIqbal\Alertify\Providers\AlertifyServiceProvider::class,
],
```

### Step 3: Publish the assets

[](#step-3-publish-the-assets)

```
php artisan vendor:publish --provider="AmjadIqbal\Alertify\Providers\AlertifyServiceProvider"
```

This will publish:

- Configuration file to `config/alertify.php`
- JavaScript assets to `public/alertify/`
- Views to `resources/views/vendor/alertify/`

Configuration
-------------

[](#configuration)

After publishing the configuration file, you can customize the default settings in `config/alertify.php`:

```
return [
    'default' => [
        'title'             => [],
        'text'              => [],
        'timer'             => env('ALERTIFY_TIMER'),
        'width'             => env('ALERTIFY_WIDTH'),
        'heightAuto'        => env('ALERTIFY_HEIGHT_AUTO'),
        'padding'           => env('ALERTIFY_PADDING'),
        'animation'         => env('ALERTIFY_ANIMATION'),
        'showConfirmButton' => env('ALERTIFY_SHOW_CONFIRM_BUTTON'),
        'showCloseButton'   => env('ALERTIFY_CLOSE_BUTTON'),
    ],

    'middleware' => [
        'title'               => '',
        'text'                => '',
        'type'                => '',
        'html'                => '',
        'toast'               => '',
        'position'            => '',
        'width'               => '',
        'showConfirmButton'   => '',
        'showCloseButton'     => '',
    ]
];
```

Usage
-----

[](#usage)

### Basic Usage

[](#basic-usage)

```
// Display a simple alert
alert(['title' => 'Hello!', 'text' => 'Welcome to Alertify', 'type' => 'success']);

// Display an alert with more options
alert([
    'title' => 'Oops...',
    'text' => 'Something went wrong!',
    'type' => 'error',
    'timer' => 3000,
    'showCloseButton' => true
]);
```

### Using with Controllers

[](#using-with-controllers)

```
public function store(Request $request)
{
    // Process the request...

    // Display a success message
    alert([
        'title' => 'Success!',
        'text' => 'Your data has been saved.',
        'type' => 'success'
    ]);

    return redirect()->back();
}
```

### Using the Middleware

[](#using-the-middleware)

You can use the included middleware to automatically display alerts based on session data. Add the middleware to your `app/Http/Kernel.php` file:

```
protected $middlewareGroups = [
    'web' => [
        // ...
        \AmjadIqbal\Alertify\Core\Alertify::class,
    ],
];
```

Then, you can flash alert data to the session:

```
$request->session()->flash('title', 'Success!');
$request->session()->flash('text', 'Operation completed successfully.');
$request->session()->flash('type', 'success');
```

### Including in Blade Templates

[](#including-in-blade-templates)

Make sure to include the Alertify scripts in your Blade templates:

```
@include('alertify::alert')
```

Available Alert Types
---------------------

[](#available-alert-types)

- `success`
- `error`
- `warning`
- `info`
- `question`

Customization
-------------

[](#customization)

You can customize the appearance and behavior of alerts by modifying the configuration or passing custom options when calling the `alert()` function.

Support
-------

[](#support)

If you encounter any issues or have questions, please feel free to create an issue on the [GitHub repository](https://github.com/AmjadIqbal/alertify-js/issues).

License
-------

[](#license)

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

Credits
-------

[](#credits)

- [Amjad Iqbal](https://github.com/AmjadIqbal)
- [AlertifyJS](http://alertifyjs.com/)

###  Health Score

15

—

LowBetter than 3% of packages

Maintenance39

Infrequent updates — may be unmaintained

Popularity0

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity14

Early-stage or recently created project

 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/a7bf302435a7ec2ff19aa5995f1baf92d6d0a4dcafbced1f3e8609fa848a4e6e?d=identicon)[amjadiqbal](/maintainers/amjadiqbal)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/amjadiqbal-alertify/health.svg)

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

###  Alternatives

[scws/pscws4

PSCWS 是英文 PHP Simple Chinese Words Segmentation 的头字母缩写，它是 SCWS 项目的前身。

1213.2k1](/packages/scws-pscws4)

PHPackages © 2026

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