Download the PHP package prologue/alerts without Composer

On this page you can find all versions of the php package prologue/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 alerts

Alerts for Laravel (v5 to v11)

Total Downloads Packagist Version

Global site messages in Laravel. Helps trigger notification bubbles with a simple API, both in the current page, and in the next page (using flash data).

Table of Contents

Installation

You can install the package for your Laravel 6+ project through Composer.

For Laravel 5.4 and below, register the service provider in app/config/app.php.

Add the alias to the list of aliases in app/config/app.php.

Configuration

The packages provides you with some configuration options.

To create the configuration file, run this command in your command line app:

The configuration file will be published here: config/prologue/alerts.php.

Usage

Adding Alerts

Since the main AlertsMessageBag class which powers the package is an extension of Illuminate's MessageBag class, we can leverage its functionality to easily add messages.

Adding Alerts Through Alert Levels

By default, the package has some alert levels defined in its configuration file. The default levels are success, error, warning and info. The AlertsMessageBag checks if you call one of these levels as a function and registers your alert which you provided with the correct key.

This makes adding alerts for certain alert types very easy:

You can of course add your own alert levels by adding them to your own config file. See above on how to publish the config file.

Flashing Alerts To The Session

Sometimes you want to remember alerts when you're, for example, redirecting to another route. This can be done by calling the flash method. The AlertsMessageBag class will put the current set alerts into the current session which can then be used after the redirect.

Displaying Alerts

Remember that the AlertsMessageBag class is just an extension of Illuminate's MessageBag class, which means we can use all of its functionality to display messages.

Or if you'd like to display a single alert for a certain alert level.

Display all messages for each alert level:

Checking For Alerts

Sometimes it can be important to see if alert's do exist, such as only load javascript/styles if they are there are some (helps for better performance).

You can check if there are any errors.

You can also get the current number of alerts.

If you'd like to learn more ways on how you can display messages, please take a closer look to Illuminate's MessageBag class.

Credits

Created by Dries Vints - he first got the idea after a blog post by Todd Francis. This package uses much of the concepts of his blog post as well as the concept of alert levels which Illuminate's Log package uses. Maintained by Cristian Tabacitu thanks to its use in Backpack for Laravel.

Changelog

You view the changelog for this package here.

License

Prologue Alerts is licensed under the MIT License.


All versions of alerts with dependencies

PHP Build Version
Package Version
Requires illuminate/config Version ~9|^10|^11.0
illuminate/session Version ~9|^10|^11.0
illuminate/support Version ~9|^10|^11.0
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 prologue/alerts contains the following files

Loading the files please wait ....