mtrdesign/krait
最新稳定版本:1.0.11
Composer 安装命令:
composer require mtrdesign/krait
包简介
Krait provides an easy way to create Ajax Datatables.
README 文档
README
Krait is a powerful Laravel package that simplifies the creation of Ajax Dynamic DataTables. It automates the initial structure development of front-end and back-end resources via simple CLI commands.
Krait Package Monorepo
To ensure consistent versioning and enhance the core front-end components development, along with the PHP package we’ve introduced a dedicated front-end
library called krait-ui. So the final package consists of two parts, included in this monorepo:
/krait-ui: The VueJS-based DataTable UI kit that includes all front-end components./krait: The main Laravel package that includes all back-end features.
Official Documentation
More information about the package can be found on the Krait Docs Website.
Quickstart
Krait's installation process is pretty simple, you can follow this guide to get everything configured quickly and then review the detailed official docs.
Installation
You can install the package via Composer by running:
composer require mtrdesign/krait
Then, you should complete the installation by running:
php artisan krait:install
It's that simple! Now you have all the JS and PHP dependencies installed and configured.
And One Final Step...
To successfully run the front-end library, you should tell the Vue to use the krait-ui plugin.
// Importing the Krait Vue plugin import Krait from "@mtrdesign/krait-ui"; // Importing the autogenerataed tables module import tables from './components/tables' /** * ... Here you initialise your VueApp ... * * const app = Vue.createApp({}); */ app.use(Krait, { tables: tables });
Usage
To create your first table, run the following command:
php artisan krait:table MyFirstTable
This command will create three resources:
/app/Tables/MyFirstTable.php- the table class definition (the table name, the columns, the callbacks, etc.)/app/Http/Controllers/Tables/MyFirstTableController.php- the controller that fetches the table content/resources/js/components/tables/MyFirstTable.vue- the front-end VueJS component that represents the data
IMPORTANT:
For consistency, all Table Classes in app/Tables should end on Table to be registered correctly.
For more details about the Installation and the Usage, please check the Official Docs.
Contribution
Don't hesitate to raise issues and propose improvements! Any help is welcome!
You can find more information about the package development process in the monorepo projects:
/krait-ui- for the front-end functionality/krait- for the back-end functionality
More contribution details can be found in the Official Contribution Section.
License
Krait is open-sourced software licensed under the MIT license.
统计信息
- 总下载量: 1.73k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 10
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-06-27