binarycabin/laravel-reporting
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';
}
binarycabin/laravel-reporting 适用场景与选型建议
binarycabin/laravel-reporting 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 86 次下载、GitHub Stars 达 0, 最近一次更新时间为 2017 年 11 月 20 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 binarycabin/laravel-reporting 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 binarycabin/laravel-reporting 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 86
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 15
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-11-20