spice-factory-ph/spice-datatable
Composer 安装命令:
composer require spice-factory-ph/spice-datatable
包简介
A Laravel package that seamlessly integrates Yajra DataTables with Bootstrap for a powerful and responsive data visualization experience.
README 文档
README
Description
Efficiently create and customize standard data tables for spice factory projects with this reusable and adaptable package.
Features
- Standard Datatable Creation: Easily generate consistent and well-formatted data tables for various applications within our projects.
- Flexible Customization: Tailor the table's visual style to match the project's branding or specific needs, ensuring seamless integration and a cohesive dev experience.
Benefits
- Promotes Code Reuse and Efficiency: Save time and effort by leveraging a standardized datatable solution across multiple projects.
- Enhances Data Presentation and Readability: Improve data visualization and analysis with clear, organized tables.
- Maintains Consistency: Ensure a cohesive look and feel across different project interfaces, fostering a professional and polished user experience.
- Adapts to Specific Needs: Customize table styles to align with branding guidelines or project-specific requirements, demonstrating versatility and adaptability.
Installation
-
require
"spice-factory-ph/spice-datatable": "dev-main"in composer.json -
Install Laravel DataTables Vite
npm i laravel-datatables-vite --save-dev -
Once installed, we can now configure our scripts and css needed for our application. in app.js
import 'laravel-datatables-vite';
Usage
Create new datatable
sail artisan make:spice-datatable {model} --buttons=a
Render the datatable inside your controller class index method with
/**
* Display a listing of the resource.
*
* @param {ModelName}DataTable $dataTable
* @return View|JsonResponse
*/
public function index({ModelName}DataTable $dataTable): View|JsonResponse
{
return $dataTable->render('{modelname}.index');
}
Update views/{model}/index.blade.php to adapt the project layout.
Add the scripts.
@push('scripts')
{{ $dataTable->scripts(attributes: ['type' => 'module']) }}
@endpush
Customizing CSS
- While this package is designed to work seamlessly with Bootstrap, you have the flexibility to tailor the appearance of individual datatable elements to your specific needs. To achieve this customization, please follow these steps:
- Publish the customizable CSS file
sail artisan vendor:publish - Select provider
Spicefactoryph\SpiceDatatable\Providers\DatatableServiceProvider - You can now add your custom styles in
public\spicedatatable\styles\app.scss
Relationship Columns
Share your thoughts!!!
- Share your feedback and experiences with other devs or lead engineer.
- Collaborate to enhance the package's capabilities and create even more versatile data table solutions for the spice factory projects.
Let's spice up your data management together! ️
spice-factory-ph/spice-datatable 适用场景与选型建议
spice-factory-ph/spice-datatable 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 3.59k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2024 年 01 月 16 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 spice-factory-ph/spice-datatable 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 spice-factory-ph/spice-datatable 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 3.59k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 18
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-01-16