Download the PHP package ipunkt/laravel-notify without Composer

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

laravel-notify

Latest Stable Version Latest Unstable Version License Total Downloads

Provides an ready to use object oriented notification interface for laravel 4, including working example javascript and css for Twitter Bootstrap 3

Installation

Add to your composer.json following lines

"require": {
    "ipunkt/laravel-notify": "1.*"
}

Add 'Ipunkt\LaravelNotify\LaravelNotifyServiceProvider', to providers in app/config/app.php. The Service provider also registers an alias Notify to your application.

On command line publish the database migrations:

$> php artisan migrate --package="ipunkt/laravel-notify"

Usage

Add somewhere in your bootstrap the shipped view composer to auto-handle the given view script:

View::composer('laravel-notify::notification', 'Ipunkt\LaravelNotify\Composers\ViewComposer');

The view composer injects a variable $notifications into the view. It is a collection of all notifications that were created or read.

Now you can use this template to display all notifications or you can use it with Bootstrap 3 in your navbar like this.

$> php artisan asset:publish ipunkt/laravel-notify

And then include the following files in your layout: /packages/ipunkt/laravel-notify/css/notify.css and /packages/ipunkt/laravel-notify/js/notify.js. The latter needs jquery to be existent.

Then go to your layout and create an <li id="notify"><a href="{{{ URL::route('notify.index') }}}"><i class="glyphicon glyphicon-warning-sign"></i></li> in your navbar navigation list.

Whenever there are notifications to be listed the ViewComposer initially fills the $notifications variable in the shipped notification view and the javascript makes an ajax call to get these and displays as menu. Without javascript the link opens a page where all notifications will be listed.

Important Notice

Do not forget to set filters for the routes build by the package. For example:

Route::when('notify/*', 'auth');

This example adds the auth filter to all package build routes.

Use-Cases

1. Message Notification

If you want to publish a simple message notification just do the following to notify users:

$user = Auth::user();
Notify::user($user, new \Ipunkt\LaravelNotify\Types\MessageNotification('Welcome on board!'));
// or
// Notify::users([$user, ...], new \Ipunkt\LaravelNotify\Types\MessageNotification('Welcome on board!'));

This sends a simple shipped message notification to the current logged in user.

2. Specific Notification

For sending application specific notifications simply create your own NotificationType.

class MyNotification extends Ipunkt\LaravelNotify\Types\AbstractNotification {
}

Then you can modify the read and done action for your needs. And you can add your own custom actions. You do not have to use only these 3 actions: created, read, done. You can build your own custom workflow. Try it out!

The AbstractNotification sends a user to the done action if he reads the notification. Override this behaviour to have your own workflow. Ending with done might be a good one, starting with created is fix by the current implementation.


All versions of laravel-notify with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
illuminate/support Version ~4.0
illuminate/auth Version ~4.0
illuminate/database Version ~4.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 ipunkt/laravel-notify contains the following files

Loading the files please wait ....