Download the PHP package kotfire/system-alerts without Composer

On this page you can find all versions of the php package kotfire/system-alerts. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package system-alerts

System Alerts for Laravel 4

This is a Laravel 4 package to add an Alert system to a web application. It is designed to easily display one or more messages in a section of the web page. These messages are managed with artisan commands.

It includes a ServiceProvider and some commands to manage the alerts and automatically attach them to the output.

Installation

This package is available on packagist, just add it to your composer.json

After updating composer, add the ServiceProvider to the providers array in app/config/app.php

The alerts will be automatically injected to the output, but if you want to load them manually or do some extra actions you can add the facade to your facades in app/config/app.php

Configuration

You can publish assets and configure it through Laravel.

To publish config file use

In the config file you may modify the default values used in the package

To publish views use

By publishing the views you may edit the template used to display the alert messages and make them your own style

Usage

Commands

The package was designed to display a Maintenance alert message before performing artisan down, but these are not the only type of alerts that can be added.

Maintenance alerts

Add new maintenance alert

Note: Parameters are optional, default values will be used if not present

Example:

or

This add new maintenance alert:

Example:

After putting app in maintenance mode using the maintenance alert message will be deleted

Note: This will not occur if you use Artisan::call('down').

Important: You only can add one maintenance alert at time, if you try to add another you will get

Delete maintenance alert

Information alerts

Information alerts are a simple way to show some information to the web app users. This kind of alerts are not deleted automatically.

Add new alert

Example:

or

Common

Delete alert by ID

View all alerts

Delete all alerts

Modifiers

There are some modifiers you can use and will be replaced when the message is displayed:

Modifier Description Example Result
{time} Show the remaining time to the maintenance datetime {time} 10 minutes
{date} Show the date to the maintenance as 'Y-m-d' {date} 2015-04-01
{datetime} Show the datetime to the maintenance as 'Y-m-d H:i:s' {datetime} 2015-04-01 12:50:20
{format|'dateformat'} Show the datetime to the maintenance as 'date format' {format|d/m/Y H:i} 01/04/2015 12:50

Sorting

Important: This feature was introduced in version 0.3, if you were using the package before this version re-publish the config file (Configuration)

Alerts can be sorted using one or more attributes.

By default the alerts will be sorted by type, then by the specified datetime and finally by the datetime they were created(all of them in ascending order).

The attribute 'type' is a bit special and needs more configurations, if you are using type sorting, you must set the priority. This is an array where the first element is the most priority and the last the less.

Configure

To configure the alerts sorting go to the config file.

Sorting can be a String(sort by ONE attribute) or an Array of strings(sort by more than one attributes).

Single attribute sorting:

Multiple attribute sorting:

To define the order used in the attributes modify order

Order can be a String(same order for all attributes) or an Array of strings(different order for each attribute).

Same order:

Different order:

Events

There are some events that will be fired:

Event name Description Parameter
system-alerts::alert.added Fired when alert was succesfully added Alert added (Array)
system-alerts::alert.deleted Fired when alert was succesfully deleted Alert deleted (Array)
system-alerts::alert.cleared Fired when all the alerts are deleted Null

Display

There are two ways to display the alerts: auto and manual

Auto

In this way alerts will be injected in all the responses containing a html element with the ID speficied in the config file (by default: 'alerts-container') using the template view to render them.

You just need to add a html container with the ID to all the views where you want to show the alerts.

Example:

Manual

If you want to inject the alerts yourself, this is perfect for you.

Ensure you have been added the facade (Installation) and set the config option 'inject' to false.

Now you may load the alerts using

and attach them to a View or do some logic with them.

License

System Alerts is open-sourced software licensed under the MIT license


All versions of system-alerts with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
illuminate/support Version 4.2.*
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package kotfire/system-alerts contains the following files

Loading the files please wait ....