承接 lancodev/laravel-analytics 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

lancodev/laravel-analytics

Composer 安装命令:

composer require lancodev/laravel-analytics

包简介

Laravel Analytics

README 文档

README

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

This package provides a simple way to capture site analytics within your existing Laravel application.

Installation

Install the package via composer:

composer require lancodev/laravel-analytics

Publish the components and views:

php artisan vendor:publish --tag="laravel-analytics-components"
php artisan vendor:publish --tag="analytics-views"

Run the package's install command:

php artisan analytics:install

Usage

Trackable Trait

The package provides an optional Trackable trait that can be used to assign page view analytics to a model. The trait provides a pageViews relationship that can be used to retrieve the page views for the model.

This would typically be implemented by the User model. However, it could also be implemented by any other model that you wish to track page views for.

To use the trait, simply add the following to your model:

namespace App\Models;

use Lancodev\LaravelAnalytics\Traits\Trackable;

class User
{
    use Trackable;
}

Tracking

To begin tracking analytics, add the <x-analytics-analytics /> component to your layout file(s). This will add the necessary JavaScript to your application.

<html>
    <head>
        <title>My Application</title>
    </head>
    <body>
        ``` content ```

        <x-analytics-analytics />
    </body>
</html>

The <x-analytics-analytics /> component accepts the following props:

  • trackable: the morphable entity to track
    • Example: <x-analytics-analytics :trackable="auth()->user()" />
    • This will associate all page view analytics with the current user

Analytics Dashboard

The package also provides a simple dashboard component that can be used to display analytics for your application.

The dashboard can be added to any view by adding the following:

<x-analytics-dashboard />

This will add the following to your page:

analyticsdashboardscreenshot.png

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.

lancodev/laravel-analytics 适用场景与选型建议

lancodev/laravel-analytics 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 18 次下载、GitHub Stars 达 2, 最近一次更新时间为 2022 年 12 月 12 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「analytics」 「laravel」 「laravel-analytics」 「lancodev」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 lancodev/laravel-analytics 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 lancodev/laravel-analytics 我们能提供哪些服务?
定制开发 / 二次开发

基于 lancodev/laravel-analytics 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 18
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 9
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-12-12