Laravel 4
I'm trying to listen to events from a class in a namespace but can't work out how to set up the listener.
I have something like:
namespace My\Namespace
class Person extends \Illuminate\Database\Eloquent\Model
...
In a separate class I have tried to listen for updates with
Event::listen('My\Namespace\Person.updated', function($person)
{
Debugbar::info(Event::firing());
});
But that never gets called. I have tried lots of different variations of upper / lower case and putting a leading \ on the namespace but nothing works
If I change the listener to
Event::listen('*.updated', function($person)
{
Debugbar::info(Event::firing());
});
The code runs and the debug output is : eloquent.updated: My\Namespace\Person
I just need to know what name to use in place of the * to make the handler specific to the namespaced class.
Thanks.
Event::fire('component.action', [...]). haven't used it yet tho.