PHPackages                             viicslen/laravel-alertable - 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. viicslen/laravel-alertable

ActiveLibrary

viicslen/laravel-alertable
==========================

This is my package laravel-alertable

v1.1.0(1y ago)0780[3 PRs](https://github.com/viicslen/laravel-alertable/pulls)MITPHPPHP ^8.1

Since Jul 7Pushed 1y ago1 watchersCompare

[ Source](https://github.com/viicslen/laravel-alertable)[ Packagist](https://packagist.org/packages/viicslen/laravel-alertable)[ Docs](https://github.com/viicslen/laravel-alertable)[ RSS](/packages/viicslen-laravel-alertable/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (12)Versions (15)Used By (0)

Laravel Alertable
=================

[](#laravel-alertable)

[![Latest Version on Packagist](https://camo.githubusercontent.com/19bcaa63c76a6836579ee1209f112b0299dba8af2ebc6d9b0666857ae959f184/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f76696963736c656e2f6c61726176656c2d616c65727461626c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/viicslen/laravel-alertable)[![GitHub Tests Action Status](https://camo.githubusercontent.com/e23819dc4201f39af8fc1b85f43e9760a07dfcf3b41c3546cfce12eaa52a64e5/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f76696963736c656e2f6c61726176656c2d616c65727461626c652f72756e2d74657374733f6c6162656c3d7465737473)](https://github.com/viicslen/laravel-alertable/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/dd5dffa24793f387e788ec7a41bd9ae9f35e9714c344230b01a4833e84ee51e3/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f76696963736c656e2f6c61726176656c2d616c65727461626c652f436865636b253230262532306669782532307374796c696e673f6c6162656c3d636f64652532307374796c65)](https://github.com/viicslen/laravel-alertable/actions?query=workflow%3A%22Check+%26+fix+styling%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/0a2fb53b7914fcd9d437f5292edfe60191df4270be678b29c2a322789d886740/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f76696963736c656e2f6c61726176656c2d616c65727461626c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/viicslen/laravel-alertable)

This is a simple package to add alerts to your laravel models.

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

[](#installation)

You can install the package via composer:

```
composer require viicslen/laravel-alertable
```

You can publish and run the migrations with:

```
php artisan vendor:publish --tag="alertable-migrations"
php artisan migrate
```

You can publish the config file with:

```
php artisan vendor:publish --tag="alertable-config"
```

This is the contents of the published config file:

```
return [
    /**
     * The default model to use for alerts.
     */
    'model' => ViicSlen\LaravelAlertable\Models\Alert::class,

    /**
     * Connection settings to use for the default alerts model.
     */
    'database' => [
        /**
         * The connection to use. If left nulls, the default connection will be used.
         */
        'connection' => null,

        /**
         * The table to use. If left nulls, the default connection will be used.
         */
        'table' => null,
    ]
];
```

Usage
-----

[](#usage)

First define any model as alertable by adding the `HasAlerts` trait to your model (and optionally the `Alertable` interface):

```
