shreesthapit / corewebvitals

v1.01 2021-12-01 16:31 UTC

This package is auto-updated.

Last update: 2024-09-29 06:14:38 UTC


README

这是一个 Laravel 8.x 包封装库,用于监控 Web Vitals 记录以检查网站性能。

文档

安装

要安装此包,请在终端中

composer require shreesthapit/corewebvitals

配置

如果您不使用自动发现,请将 ServiceProvider 添加到 config/app.php 中的 providers 数组中

Shreesthapit\Corewebvitals\CoreWebVitalServiceProvider::class,

使用发布命令将包配置复制到本地配置中

php artisan vendor:publish --provider="Shreesthapit\Corewebvitals\CoreWebVitalServiceProvider"

迁移存储核心 Web Vitals 记录所需的表。

php artisan migrate

收集数据

您需要在 blade 布局或要监控的页面下添加以下标签。

<x-core-web-vital-core-web-component/>

收集数据的洞察

您可以在以下 URI 中查看收集数据的洞察

/core-web-vital-insight

许可证

Laravel 框架是开源软件,根据 MIT 许可证 许可。