tormjens / eventy

WordPress-like actions and filters for Laravel

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Usage without Laravel

filips123 opened this issue · comments

Is it possible to use this package without Laravel Framework?
I want to use it with Slim Framework.

How can I do this?

Sure. Shouldn’t be a problem as it does not depend on the Laravel framework itself.

I’m not familiar with Slim Framework, but the idea is that Eventy is created once per request (singleton). If Slim uses a dependency injection service you would simply instantiate a new instance of the Events class.

The methods exposed in the Events class is the same as the facade in Laravel, so instead of Eventy:: it would be $instance->

Yes, usage without Laravel is possible. Slim has Pimple dependency injection container, so I can set Eventy there.

I also create a fork of this project (filips123/eventy) which uses PHP arrays instead of Laravel Collection. It doesn't has any dependencies and it requires only PHP 5.4 or later.

Nice 👍