Download the PHP package koalabs/evento without Composer

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

Laravel Evento

Dead simple event management for your Laravel application. This is just our way of managing events. Use with care.

NOTE: Most of the code is inspired on Jeffrey Way's awesome Laracasts series.

Installation

You know this one already.

In your application's root directory, open up the composer.json file and add the package to the require section so it looks like this:

Open the command line, and in the root of your application, run the Composer update like this:

Now let's add the Evento Service Provider. Open the app/config/app.php file and in the providers array, add the following line:

Optionally, you may want to add the Facade for beautiful Laravel-friendly semantics. In your aliases array in the same app configuration file, add:

Usage

The way I picture myself using this is directly on the controllers. Using it alongside a repository pattern or even in your models is also valid.

Now imagine you were creating an application for managing a podcasts directory. You'd have a PodcastsController with all the usual CRUD methods. For the sake of simplicity, let's only look at the store method. It could look something like this:

Now it is most likely you'll want to create a folder in which to keep all your events. I'd call this the Events folder. The PodcastAdded class is an example for how to name your events inside that folder.

Listening for the events

After raising the events, you will then want to listen to them. For this, Evento provides you with a handy class: EventListener. To use it you'll simply have to extend it:

It's important to note the naming convention: Every method handling an event has to start with the word when.

One nice little trick

You can automate much of your Event listening with a Service Provider of your own. Try this (maybe inside a Listeners folder or something):

Oh and don't forget to export the configuration files.:

php artisan config:publish koalabs/evento


All versions of evento 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 koalabs/evento contains the following files

Loading the files please wait ....