mehadi/laravel-crud-generator
Composer 安装命令:
composer require mehadi/laravel-crud-generator
包简介
A laravel package to generate CRUD by giving Model and database table column
README 文档
README
Introduction
Welcome to the Laravel CRUD Generator 🖥️🔥! This package provides a convenient way to quickly generate CRUD (Create, Read, Update, Delete) functionality for your Laravel projects.
Installation
To integrate the Laravel CRUD Generator into your Laravel project, follow these steps:
- Open your terminal and navigate to your project's root directory.
- Run the following command to install the package via Composer:
composer require mehadi/laravel-crud-generator
Features
The Laravel CRUD Generator offers the following features:
- Automatically creates the Model, Migration, Controller, and View files for your CRUD operations.
- Adds a menu item to the navigation for easy access to the generated CRUD pages.
- Sets up the necessary routes in the
web.phpfile. - On deletion, it removes all the files generated by the CRUD operations.
- Input fields
[text, textarea, email, number, file] - File uploading
- Deleting old file when updating any model post
- Simple Form validation
Usage
Once you've installed the package and set up the prerequisites, you can use the Laravel CRUD Generator to quickly create CRUD operations for your models. Here's how:
- Open your terminal in the root directory of your Laravel project.
- Use the following command to generate CRUD files for a specific model (e.g.,
Post) along with its columns:
php artisan crud:make Post --data='title:string:input,description:text:textarea,image:text:file'
-
The first parameter (
Postin this example) is the name of the model. -
The second parameter (
--data) specifies the table columns for the model, where each column is defined ascolumn_name:data_type. -
Certainly, let's break down secound parameter (
--data='title:string:input,description:text:textarea,image:text:file'): -
image: This is the name of the column in the database table. It represents a field in the table where you'll store information related to images. -
text: This is the data type assigned to the column in the database. In this case, it's set to "text," which indicates that the column can store a longer text-based content. -
file: This refers to the input type that you would use in the user interface (UI) for uploading files. In the context of HTML forms, this would be an<input>element withtype="file". This allows users to select and upload files, such as images, from their devices.
- After creating a new Model, be sure to execute the following command:
php artisan migrate
Running this command is important to ensure that any database changes related to the new Model are properly applied. This helps keep your database schema synchronized with your application's data structure. 4. To delete all the generated CRUD files and clean up, use the following command:
php artisan crud:delete Post
- To make these uploaded files accessible from the web, you need to create a symbolic link from the public/storage directory to the storage/app/public directory. This can be done using the following Artisan command:
php artisan storage:link
After running this command, Laravel will create a symbolic link that allows files in the storage/app/public directory to be accessed through the URL http://your-app-url/storage.
Prerequisites
Before using the Laravel CRUD Generator, make sure you have the following prerequisites set up in your project:
- Install Laravel Breeze package:
composer require laravel/breeze
- Run the Breeze installation command and choose the Blade template option:
php artisan breeze:install
- Run the migration command to set up the database tables:
php artisan migrate
- Install npm packages:
npm install
- Compile the assets with the following command:
npm run dev
Screenshots
Add new Post form
List Post
Notes
- This package helps automate the process of generating CRUD operations for your Laravel models, saving you time and effort.
- Ensure that you have all the prerequisites installed and set up correctly before using the CRUD generator.
For more information, visit the GitHub repository or the Packagist page of the package.
mehadi/laravel-crud-generator 适用场景与选型建议
mehadi/laravel-crud-generator 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1.53k 次下载、GitHub Stars 达 3, 最近一次更新时间为 2023 年 08 月 24 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「crud-generator」 「laravel-crud-generator」 「laravel-auto-crud」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 mehadi/laravel-crud-generator 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 mehadi/laravel-crud-generator 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 mehadi/laravel-crud-generator 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Generate CRUD for your laravel application like a breeze
MVC code generator for Codeigniter 3.
laravel crud generator with repository pattern
CRUDBooster Is CRUD Generator Based On Laravel Easy To Make An Advanced Backend Fork by Febrian Reza
A simple Laravel library that allows you to create crud operations with a single command
CRUDBooster Is CRUD Generator Based On Laravel Easy To Make An Advanced Backend
统计信息
- 总下载量: 1.53k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 16
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-08-24

