承接 amdadulhaq/crud-generator-laravel 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

amdadulhaq/crud-generator-laravel

Composer 安装命令:

composer require amdadulhaq/crud-generator-laravel

包简介

A package to generate CRUD operations easily.

README 文档

README

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

Overview

The CRUD Generator package for Laravel is a command-line tool that helps you quickly create a complete CRUD (Create, Read, Update, Delete) setup for your models, including migration files, controllers, and Blade views. This package streamlines the development process by generating the necessary files with minimal input from the developer.

Features

  • Generate models with fillable properties.
  • Create migration files with specified fields.
  • Generate controllers with all necessary CRUD methods.
  • Create Blade views for listing, creating, editing, and showing model instances.
  • Automatically add resource routes to web.php.

Requirements

  • PHP >= 8.2
  • Laravel >= 10.x, 11.x, 12.x, 13.x

Installation

  1. Install the package via Composer:

    composer require amdadulhaq/crud-generator-laravel
  2. Register the Service Provider (if not using auto-discovery):

    In config/app.php, add the service provider to the providers array:

    AmdadulHaq\CRUDGenerator\CrudServiceProvider::class,
  3. Publish the configuration file (optional):

    You can publish the configuration file to customize the package behavior:

    php artisan vendor:publish --provider="AmdadulHaq\CRUDGenerator\CrudServiceProvider"

    This will create a crud_generator.php file in your config directory.

Usage

To generate CRUD resources, use the following Artisan command:

php artisan make:crud {name} {--fields=}

Parameters

{name} (optional): The name of the model you want to create. {--fields=} (optional): A comma-separated list of fields for the model, in the format fieldName:fieldType.

Example

  1. Generate a CRUD setup for a Post model with fields: title (string) and content (text):

    php artisan make:crud Post --fields="title:string,content:text"
  2. If you do not provide the --fields option, you will be prompted to enter fields interactively:

    php artisan make:crud

    You will then enter model and field names and types one by one until you finish.

Generated Files

The command will create the following files:

Model: app/Models/Post.php

Migration: database/migrations/YYYY_MM_DD_HHMMSS_create_posts_table.php

Controller: app/Http/Controllers/PostController.php

Blade Views:

resources/views/posts/index.blade.php

resources/views/posts/create.blade.php

resources/views/posts/edit.blade.php

resources/views/posts/show.blade.php

Resource Routes: Automatically added to routes/web.php

Configuration

You can customize the behavior of the CRUD generator by modifying the config/crud_generator.php file. The following options are available:

generate_model: Generate a model (default: true).

generate_migration: Generate a migration (default: true).

generate_controller: Generate a controller (default: true).

generate_blade: Generate Blade views (default: true).

generate_route: Add resource routes (default: true).

License

The MIT License (MIT). Please see License File for more information.

Contributing

Contributions are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request.

amdadulhaq/crud-generator-laravel 适用场景与选型建议

amdadulhaq/crud-generator-laravel 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 11 次下载、GitHub Stars 达 0, 最近一次更新时间为 2024 年 10 月 19 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 amdadulhaq/crud-generator-laravel 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 amdadulhaq/crud-generator-laravel 我们能提供哪些服务?
定制开发 / 二次开发

基于 amdadulhaq/crud-generator-laravel 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-10-19