I want to know what events are fired by Laravel core libraries. I want to get the complete list, such as laravel.query and laravel.done.

There are four events listed at the official docs, but I think Laravel has more events than these four!

推荐答案

拉威尔并不像你想象的那么多.虽然它确实利用了事件系统,但开发人员可以在这些应用程序中使用它.总之,这是我整理的 list .

laravel.done
laravel.log
laravel.query
laravel.resolving
laravel.composing: {viewname}
laravel.started: {bundlename}
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
eloquent.booted: {$model}
eloquent.booting: {$model}


500
404

The 500 and 404 are both error related events. These are set in the routes.php file so you can see what the default listener is.

我想指出的是,eloquent.{event}有另一个变体,其中包含正在更新的类名.

eloquent.{event}: {classname}

我不会说这绝对是一切,但它应该至少是99%.

Laravel相关问答推荐

@vite指令在使用laravel vite构建后导致错误

当未通过验证的字段是值数组时,Laravel$validator->;validator()方法不会引发异常

如何定制有关密码被泄露的Laravel Breeze S消息?

如何使用 laravel 更新单个值

Laravel Horizo​​n 限制与优化

在 Laravel 中清除 Routes&config:cache 后未定义的常量

在 Laravel 包中的路由上使用显式或隐式模型绑定

在 laravel 4.2 中,用户 'root'@'localhost' 的 Laravel 访问被拒绝(使用密码:YES)

指令allow_call_time_pass_reference警告

具有实时和 WebSockets 的 Angular2 + Laravel

PHP 中的 Http 响应代码枚举

Laravel 中未加密的 cookie

如何在没有 Artisan 的情况下运行 Laravel?

升级到 Laravel 5.2 会使所有会话失效

如何使用中间件将标头添加到响应中?

Laravel 初学者的良好开端

Laravel/Lumen 中两列之间的 SQL

Laravel 不活动时间设置

Laravel 5 默认注册后如何发送邮件?

以编程方式而不是从 CLI 运行 Laravel 5 seeder