zunfuyuzora/ukyotable
Composer 安装命令:
composer require zunfuyuzora/ukyotable
包简介
Ukyo will help you to Serve Datatable for Laravel 8
README 文档
README
Description
Ukyo Table is appear to be a helpful package to handle your data for creating simple Datatable
Background
Handling datatable for many model is painful. You can do copy paste but is not adaptable for upgrading datatable feature if implmemented too many datatable.
With my basic understanding and passion for making useful and save my time for developing feature, I will do my best to make this thing useful and good enough. So that I can boost my productivity and maybe other
Installation
Simply run composer on your laravel project. >w<)>
composer require zunfuyuzora/ukyotable
Usage/Examples
Set Model to extends for UkyoModel and add UkyoGather() method as eloquent query builder that will be used as reference for Ukyo to serve you.
// file: App/Models/Food
class Food extends UkyoModel {
public function UkyoGather() {
return self::query()
}
}
Use on your controller that used for handling ajax request from datatable.
// file: App/Http/Controller/FoodController.php
public function list(Request $request) {
$datatable = UkyoTable::from($request)->get(Food::class)
return $datatable->getResponseArray();
}
On your jquery datatable instantion, define something like this
<script>
$(document).ready(function() {
$('#table').DataTable({
searching: true,
lengthChange: true,
columns: [
{ data: 'ukyoCounter' },
{ data: 'name' },
{ data: 'category' },
{ data: 'price' },
{ data: 'discount' },
]
})
})
</script>
FAQ
Is it stable?
Of course not! >w<)/)
Need Help?
No need!! >w<)/)
统计信息
- 总下载量: 3
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-08-02