adwiv/laravel-crud-daisyui
Composer 安装命令:
composer require adwiv/laravel-crud-daisyui
包简介
Generate CRUD Model, Controller, Resource, Request and Views for Laravel with DaisyUI
README 文档
README
Laravel CRUD & View Generator
This package generates model, controllers, request, resource and views for CRUD operations.
This package is meant primarily for personal use.
Installation
Install the package in the development mode only. Since the package generates files, it isn't needed at all during production.
composer require --dev adwiv/laravel-crud-daisyui npm i -D daisyui@latest sweetalert2
add daisyui to resources/css/app.css
@plugin 'daisyui'; @layer components { .table-hover tr { @apply hover:bg-base-300; } .input-validator { &:user-invalid, &:has(:user-invalid), &[aria-invalid]:not([aria-invalid="false"]) { @apply validator; } } .select select:not([multiple]) { color: color-mix(in oklch, currentColor 50%, #0000); } .select select:has(option:checked:not([value])), .select select:has(option:checked:not([value=""])) { color: currentColor; } }
update resources/js/app.js
import Swal from 'sweetalert2'; window.Swal = Swal;
Usage
To use this generator, you must have an existing database table for the model and CRUD you want to generate. First, create a migration, and migrate it to create the tables. Then, to generate all files use one of the following commands
php artisan crud:all Student php artisan crud:all Student [--prefix admin] php artisan crud:all Student [--route-prefix admin] [--view-prefix admin] php artisan crud:all Student [--table students]
You can also generate individual files:
# Create Student model from students table php artisan crud:model Student # Create enums for all enum & set fields in students table php artisan curd:enum Student # Create the Request class for Student Model php artisan crud:request StudentRequest # Create the Resource class for Student Model php artisan crud:resource StudentResource # Create the Resource controller Student Model php artisan crud:controller Admin/StudentController # Create the API Resource controller Student Model php artisan crud:controller Api/StudentController --api # Create the index view for student model (admin/students/index.blade.php) php artisan crud:view admin.students.index # Create the index view for student model (admin/students/show.blade.php) php artisan crud:view admin.students.show # Create the index view for student model (admin/students/edit.blade.php) php artisan crud:view admin.students.edit
adwiv/laravel-crud-daisyui 适用场景与选型建议
adwiv/laravel-crud-daisyui 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 21 次下载、GitHub Stars 达 1, 最近一次更新时间为 2025 年 05 月 09 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 adwiv/laravel-crud-daisyui 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 adwiv/laravel-crud-daisyui 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 21
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 20
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-05-09