binarycabin/laravel-reporting 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

binarycabin/laravel-reporting

最新稳定版本:1.0.0

Composer 安装命令:

composer require binarycabin/laravel-reporting

包简介

Basic tools for building reports

README 文档

README

Basic tools for building reports

composer require binarycabin/laravel-reporting

Available Traits

\BinaryCabin\LaravelReporting\Traits\Sortable

Provides a scope to pass sortable values to a query:

// (/users?sort=last_name&sort_order=ASC)
$users = \App\User::sort($request->all())->get();

On your model, add the properties below to set the default sorting when none is passed:

protected $sortFieldDefault = 'id'; protected $sortOrderDefault = 'ASC';

\BinaryCabin\LaravelReporting\Traits\Filterable

Provides scopes to add filtering to your query:

\App\User::filter($request->all())->get();

On your model, add a filterable property to determine all columns allowed to be filtered:

protected $filterable = [
        'first_name',
        'last_name',
        'global',
];

If a scope with the filterable name exists, it will be used in the filter. A scope "global" is provided in the trait. This will look through all fields in your "filterableGlobal" array for the passed query

    protected $filterableGlobal = [
        'first_name',
        'company',
    ];
\App\User::filter(['global'=>'ABC Company'])->get();

Available Views

A sortable button is included to pass the "sort" and "sort_order" request values when viewing a table:

<th>@include('reporting::components.sort-button',['sortField'=>'created_at']) Date Created</th>

Available Controllers

An extendable controller is also available, which provides basic CRUD operation, along with default Sort/Filter functionality. To use this controller, simply create a controller extending it and passing available properties shown below:

<?php

namespace App\Http\Controllers\Manage\Users;

use BinaryCabin\LaravelReporting\Http\Controllers\BaseManageController;

class UserController extends BaseManageController
{

    protected $modelClass = \App\User::class;
    protected $baseTitlePlural = 'Users';
    protected $baseTitleSingular = 'User';
    protected $variableNamePlural = 'users';
    protected $variableNameSingular = 'user';
    protected $baseRoute = 'manage/user';
    protected $viewIndex = 'manage.user.index';
    protected $viewCreate='manage.user.create';
    protected $viewEdit='manage.user.edit';

}

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-11-20

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固