Laravel 4.1 Model::boot not always firing -



Laravel 4.1 Model::boot not always firing -

i decided follow various "best practice" recommendations i've seen , set event::listen code in model::boot static method relevant model. works half dozen of them, fails execute others.

all extend same base of operations class (which in turn extends \illuminate\database\eloquent\model)

all utilize public static function boot() method

all utilize same \event::listen('event',function(){}); format

it's not problem multiple listeners, can set 2 in same working model , both trigger, none every triggered in non-working ones.

there's not code paste in, i'm using by-the-book (to best of knowledge) code,

class myclass extends \illuminate\database\eloquent\model { public static function boot() { \event::listen('my.event', function($arg1, $arg2){ \log::debug("this may or may not trigger."); }); } }

no exceptions thrown, no errors logged, doesn't run. can c&p code 1 of "working" models , work expected.

is there obscure problem or nuance i'm missing? inconsistency maddening.

are using model in code? laravel lazy auto-loads - dont think boot model until needed?

laravel laravel-4

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -