Download the PHP package cornford/notifier without Composer

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

An easy way to send notification messages to a client using AJAX in Laravel.

Latest Stable Version Total Downloads Build Status Scrutinizer Code Quality

For Laravel 4.x, check version 1.0.1

Think of Notifier as an easy way to send notification messages to a client using AJAX in Laravel. These include:

Installation

Begin by installing this package through Composer. Edit your project's composer.json file to require cornford/notifier.

"require": {
    "cornford/notifier": "1.*"
}

Next, update Composer from the Terminal:

composer update

Once this operation completes, the next step is to add the service provider. Open app/config/app.php, and add a new item to the providers array.

'Cornford\Notifier\Providers\NotifierServiceProvider',

The next step is to introduce the facade. Open app/config/app.php, and add a new item to the aliases array.

'Notifier'         => 'Cornford\Notifier\Facades\NotifierFacade',

We then need to introduce the configuration files, JavaScripts and Stylesheets, by running the following command.

php artisan vendor:publish --provider="Cornford\\Notifier\\Providers\\NotifierServiceProvider"

That's it! You're all set to go.

Usage

It's really as simple as using the Logical class in any Controller / Model / File you see fit with:

Notifier::

This will give you access to

Notification

The notification method allows you to create a notification, with parameters for message, type and expiry as an integer of minutes or DateTime object.

Notifier::notification('This is a message', Notification::NOTIFICATION_TYPE_INFO, 0);
Notifier::notification('This is a message', Notification::NOTIFICATION_TYPE_NONE, new DateTime('tomorrow'));

None

The none method allows you to create a none notification, with parameters for message and expiry as an integer of minutes or DateTime object.

Notifier::none('This is a message', 0);
Notifier::none('This is a message', new DateTime('tomorrow'));

Info

The info method allows you to create an information notification, with parameters for message and expiry as an integer of minutes or DateTime object.

Notifier::info('This is a message', 0);
Notifier::info('This is a message', new DateTime('tomorrow'));

Success

The success method allows you to create a success notification, with parameters for message and expiry as an integer of minutes or DateTime object.

Notifier::success('This is a message', 0);
Notifier::success('This is a message', new DateTime('tomorrow'));

Warning

The warning method allows you to create a warning notification, with parameters for message and expiry as an integer of minutes or DateTime object.

Notifier::warning('This is a message', 0);
Notifier::warning('This is a message', new DateTime('tomorrow'));

Danger

The danger method allows you to create a danger notification, with parameters for message and expiry as an integer of minutes or DateTime object.

Notifier::danger('This is a message', 0);
Notifier::danger('This is a message', new DateTime('tomorrow'));

Danger

The danger method allows you to create a danger notification, with parameters for message and expiry as an integer of minutes or DateTime object.

Notifier::danger('This is a message', 0);
Notifier::danger('This is a message', new DateTime('tomorrow'));

Set Options

The setOptions method allows you to set the current set of Notifier options using a parameter for options as an array.

Notifier::setOptions(['option' => 'value']);

Get Options

The getOptions method allows you to fetch the current set of Notifier options as an array.

$options = Notifier::getOptions();

Set Notifications

The setNotifications method allows you to the current set of notifications with an array of notifications objects.

Notifier::setNotifications([new Notification('This is a message', Notification::NOTIFICATION_TYPE_NONE, new DateTime('now'), 1)]);

Get Notifications

The getNotifications method allows you to the fetch the current set of notifications as an array of notifications objects.

$notifications = Notifier::getNotifications();

Assets

The assets method allows you to the include the necessary Notifier assets to your template files, with an optional parameter for type.

{!! Notifier::assets() !!}
{!! Notifier::assets('cdn') !!}

Get Display Notifications

The getDisplayNotifications method allows you to get the current set of displayable notifications.

$notifications = Notifier::getDisplayNotifications();

Display Notifications

The displayNotifications method allows you to mark an array of passed notifications as displayed.

$notifications = Notifier::getNotifications();
Notifier::displayNotifications($notifications);

Displayed Displayable Notifications

The displayedDisplayableNotifications method allows you to mark displayable notifications as displayed.

Notifier::displayedDisplayableNotifications();

Displayed All Notifications

The displayedAllNotifications method allows you to mark all notifications as displayed.

Notifier::displayedAllNotifications();

Expire Notifications

The expireNotifications method allows you to expire an array of passed notifications.

$notifications = Notifier::getNotifications();
Notifier::expireNotifications($notifications);

Expire Displayed Notifications

The expireDisplayedNotifications method allows you to expire all displayed notifications.

Notifier::expireDisplayedNotifications();

Expire All Notifications

The expireAllNotifications method allows you to expire all notifications.

Notifier::expireAllNotifications();

Fetch Notifications

The fetchNotifications method allows you to fetch all notifications from the session.

Notifier::fetchNotifications();

Store Notifications

The storeNotifications method allows you to store all notifications into the session.

Notifier::storeNotifications();

To Array

The toArray method allows you convert an array of Notification objects to an array of arrays.

$notifications = Notifier::getNotifications();
Notifier::toArray($notifications);

License

Notifier is open-sourced software licensed under the MIT license


All versions of notifier with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
illuminate/view Version 5.*
illuminate/session Version 5.*
illuminate/support Version 5.*
illuminate/http Version 5.*
illuminate/routing Version 5.*
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 cornford/notifier contains the following files

Loading the files please wait ....