Laravel 4 how to listen to a model event?

前端 未结 4 1842
孤城傲影
孤城傲影 2020-12-30 04:09

I want to have an event listener binding with a model event updating.
For instance, after a post is updated, there\'s an alert notifying the updated post ti

4条回答
  •  执念已碎
    2020-12-30 04:31

    Event::listen('eloquent.created: ModelName', function(ModelName $model)   {
        //...
    })
    

提交回复
热议问题