定制 adwiv/laravel-crud-daisyui 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

adwiv/laravel-crud-daisyui

最新稳定版本:0.4.3

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

统计信息

  • 总下载量: 21
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-05-09

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固