承接 ppranav/table-insights 相关项目开发

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

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

ppranav/table-insights

最新稳定版本:1.6

Composer 安装命令:

composer require ppranav/table-insights

包简介

TableInsights is a powerful package designed specifically for back-end developers using the Laravel framework. It allows for easy conversion of database tables into meaningful statistics and insights using just a model.

README 文档

README

TableInsights is a powerful package designed specifically for back-end developers using the Laravel framework. It allows for easy conversion of database tables into meaningful statistics and insights using just a model.

Getting Started

Prerequisites

  • Laravel Framework

Installation

You can install the package via composer:

composer require ppranav/table-insights

You can load the package's config file by running:

php artisan vendor:publish --tag=tableinsights

The config file allows you to customize the tableinsights's settings.

You can customize the key names of your Tableinsights array and enable or disable individual keys to better suit your needs. To change a key name, enter/replace the desired key name in the right field.

Usage

Extend the class \Ppranav\TableInsights\TableInsights in your own class and implement a models() method in the following code:

/**
 * Add arrays of models
 * @return array<Model, string>
 */
public function models() {
    return [
        Project::class => 'created_at',
        TaskLog::class => 'committed_at'
    ];
}

You may also update models query using the following code:

public function setQuery(Activity $activity)
{
    return $activity->query()->where(‘user_id’, auth()->id());
}

Finally, Your Implementation class should look like this:

class Dashboard extends TableInsights
{

    /**
     * Add arrays of models
     * @return array<Model, string>
     */
    public function models() {
        return [
            Project::class => 'created_at',
            TaskLog::class => 'committed_at'
        ];
    }

    public function setQuery(Activity $activity)
    {
        return $activity->query()->where('created_for_id', auth()->id());
    }
}

Show insights in a controller

 return (new Dashboard())->getInsights();

Screenshots

App Screenshot

License

MIT

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-01-27

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固