vickymaulana/buatcrud
Composer 安装命令:
composer require vickymaulana/buatcrud
包简介
A Laravel package to generate CRUD operations with advanced features.
README 文档
README
This package provides an easy-to-use Artisan command to generate a complete CRUD (Create, Read, Update, Delete) system in Laravel projects. It supports advanced features such as custom fields, automatic view generation, route management, sidebar integration, and request validation.
Features
- Customizable CRUD Generation: Easily define custom fields and generate the necessary migration, model, controller, and views.
- Form Request Validation: Automatically includes form requests for input validation.
- Blade Templates for Views: Generates views for listing, creating, editing, and showing records.
- Sidebar Integration: Offers an option to integrate the generated CRUD into your Laravel project's sidebar.
- Automatic Route Handling: Adds routes for the generated CRUD operations in
web.php. - Laravel Policy Generation: Generates policies to handle authorization for the generated model.
Installation
To install the package in your Laravel project, you can add it via Composer:
composer require vickymaulana/buatcrud
Alternatively, you can manually add it to your composer.json:
{
"require": {
"vickymaulana/buatcrud": "^1.0"
}
}
Then, run:
composer update
Service Provider
Once installed, the package will automatically register its service provider using Laravel's auto-discovery feature. However, if you need to manually register the service provider, you can do so in the config/app.php file:
'providers' => [ // Other Service Providers VickyMaulana\BuatCrud\BuatCrudServiceProvider::class, ],
Usage
After installing the package, you can use the following Artisan command to generate CRUD operations for any model:
php artisan buatcrud {name} --fields={field1:type1,field2:type2,...}
{name}: The name of the model for which you want to generate CRUD (e.g.,Product).--fields: Specify fields and their types in the formatfield:type. Types can include typical Laravel migration types likestring,text,integer,decimal, etc.
Example:
php artisan buatcrud Product --fields="name:string,price:decimal,description:text"
This command will generate:
- A model and migration for
Product. - A resource controller for CRUD operations.
- Blade templates for listing, creating, editing, and viewing the product.
- Form request validation rules.
- Optional sidebar link (with confirmation).
Package Structure
- src/: Contains the package source code, including the service provider and console command.
- BuatCrudServiceProvider: Registers the package and makes the command available.
- Commands/BuatCrud.php: The Artisan command logic that generates the CRUD files.
Requirements
- Laravel 11+
- PHP 8.2+
- Laravel11-Stisla
License
The BuatCrud package is open-sourced software licensed under the MIT license.
Author
- Vicky Maulana
GitHub: vickymaulana
Email: vickymaulanna@gmail.com
Feel free to contribute by submitting pull requests, reporting issues, or suggesting features.
vickymaulana/buatcrud 适用场景与选型建议
vickymaulana/buatcrud 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 10 次下载、GitHub Stars 达 0, 最近一次更新时间为 2024 年 10 月 17 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 vickymaulana/buatcrud 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 vickymaulana/buatcrud 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 10
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 4
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-10-17