hussainabuhajjaj/codebot
Composer 安装命令:
composer require hussainabuhajjaj/codebot
包简介
AI-powered Laravel component generator
README 文档
README
# Codebot Laravel Package Codebot is a Laravel package that uses **DeepSeek AI** to generate **migrations**, **models**, and **views** with designs using popular frameworks like **Bootstrap** and **Tailwind CSS**. It simplifies the process of scaffolding Laravel applications by automating repetitive tasks. ## Features - Generate **migrations** with fields and relationships. - Generate **models** with fillable attributes and relationships. - Generate **views** with **Bootstrap** or **Tailwind CSS** designs. - Interactive command-line interface for easy usage. - Customizable templates for migrations, models, and views. --- ## Installation 1. Install the package via Composer: ```bash composer require hussainabuhajjaj/codebot-laravel
-
Publish the configuration file (optional):
php artisan vendor:publish --provider="Hussainabuhajjaj\Codebot\CodebotServiceProvider" --tag="config"
-
Set your DeepSeek API key in the
.envfile:DEEPSEEK_API_KEY=your-api-key-here
Usage
Run the following command to generate code interactively:
php artisan codebot:generate
Example Workflow
-
Generate a Migration:
- Enter the table name (e.g.,
users). - Add fields (e.g.,
name:string,email:string,password:string). - Add relationships (e.g.,
hasMany:posts).
- Enter the table name (e.g.,
-
Generate a Model:
- The model will be created with fillable attributes and relationships.
-
Generate Views:
- Choose a design framework (e.g., Bootstrap or Tailwind CSS).
- Views will be generated for listing, creating, and editing records.
Examples
Example 1: Generate a users Table
-
Run the command:
php artisan codebot:generate
-
Follow the prompts:
- Table name:
users - Fields:
name:stringemail:stringpassword:string
- Relationships:
hasMany:posts - Design framework:
bootstrap
- Table name:
-
Results:
- A migration file is created:
Schema::create('users', function (Blueprint $table) { $table->id(); $table->string('name'); $table->string('email')->unique(); $table->string('password'); $table->timestamps(); });
- A model file is created:
class User extends Model { protected $fillable = ['name', 'email', 'password']; public function posts() { return $this->hasMany(Post::class); } }
- Views are created with Bootstrap styling:
resources/views/users/index.blade.phpresources/views/users/create.blade.phpresources/views/users/edit.blade.php
- A migration file is created:
Example 2: Generate a posts Table
-
Run the command:
php artisan codebot:generate
-
Follow the prompts:
- Table name:
posts - Fields:
title:stringcontent:textuser_id:integer
- Relationships:
belongsTo:user - Design framework:
tailwind
- Table name:
-
Results:
- A migration file is created:
Schema::create('posts', function (Blueprint $table) { $table->id(); $table->string('title'); $table->text('content'); $table->foreignId('user_id')->constrained(); $table->timestamps(); });
- A model file is created:
class Post extends Model { protected $fillable = ['title', 'content', 'user_id']; public function user() { return $this->belongsTo(User::class); } }
- Views are created with Tailwind CSS styling:
resources/views/posts/index.blade.phpresources/views/posts/create.blade.phpresources/views/posts/edit.blade.php
- A migration file is created:
Results
After running the codebot:generate command, you’ll have the following files:
-
Migrations:
- Located in
database/migrations. - Ready to be applied using
php artisan migrate.
- Located in
-
Models:
- Located in
app/Models. - Includes fillable attributes and relationships.
- Located in
-
Views:
- Located in
resources/views. - Styled with Bootstrap or Tailwind CSS.
- Located in
-
Routes:
- Add routes in
routes/web.phpto access the generated views:Route::resource('users', UserController::class); Route::resource('posts', PostController::class);
- Add routes in
Contributing
Contributions are welcome! Here’s how you can contribute:
- Fork the repository.
- Create a new branch:
git checkout -b feature/your-feature-name
- Commit your changes:
git commit -m "Add your feature" - Push to the branch:
git push origin feature/your-feature-name
- Open a pull request.
License
This package is open-source software licensed under the MIT License.
Support
If you encounter any issues or have questions, please open an issue on GitHub.
Enjoy using Codebot! 🚀
hussainabuhajjaj/codebot 适用场景与选型建议
hussainabuhajjaj/codebot 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 3 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 01 月 25 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「migrations」 「bootstrap」 「laravel」 「models」 「views」 「ai」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 hussainabuhajjaj/codebot 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 hussainabuhajjaj/codebot 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 hussainabuhajjaj/codebot 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Symfony ClickhouseMigrationsBundle
Very simple SQL-based database migrations tool - a heavily stripped down fork of robmorgan/phinx
Laravel table comments loader (part of Diplodocker project)
A lightweight, secure-by-default PHP microframework built on Slim – providing Laravel-like features (ORM, authentication, migrations, caching) without the bloat. Perfect for building REST APIs and small-to-medium PHP applications.
Views for the package MedicOneSystems Livewire Datatables with Bootstrap 4
bootstrap select field module implementing http://silviomoreto.github.io/bootstrap-select/
统计信息
- 总下载量: 3
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 7
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-01-25