gpt4 book ai didi

Laravel 4 : which events does it support/have?

转载 作者:行者123 更新时间:2023-12-01 09:02:02 33 4
gpt4 key购买 nike

我看到了this SO question关于 Laravel 事件,但它们适用于 Laravel 3。我已经尝试了所有这些,但它们都不起作用。这是我在 global.php 中的代码:

$event_names = array("laravel.done", "laravel.log", "laravel.query", "laravel.resolving", "laravel.composing", "laravel.started", "laravel.controller.factory", "laravel.config.loader", "laravel.language.loader", "laravel.view.loader", "laravel.view.engine", "view.filter", "eloquent.saving", "eloquent.updated", "eloquent.created", "eloquent.saved", "eloquent.deleting", "eloquent.deleted");
foreach ($event_names as $event_name) {
echo "Listening to {$event_name}<br/>";
Event::listen($event_name, function($event) {
var_dump($event);
exit;
});
}

它只是开始监听,但没有触发任何事件。我已经尝试使用 Event::fire() 自己触发它们并且它有效,但显然这不是我想要的。

最佳答案

我在 laravel wiki 中找到了这个列表:http://wiki.laravel.io/Event_List_(Laravel_4)

关于Laravel 4 : which events does it support/have?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15212652/

33 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com