chaoswd/laravel-mongo-models 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

chaoswd/laravel-mongo-models

最新稳定版本:v1.0.1

Composer 安装命令:

composer require chaoswd/laravel-mongo-models

包简介

A lightweight Laravel package that adds an Artisan command for generating MongoDB Eloquent models using the official mongodb/laravel driver.

README 文档

README

Latest Version on Packagist Total Downloads GitHub Stars GitHub License

A lightweight Laravel package that adds an Artisan command for generating MongoDB Eloquent models...

🚀 Installation

You can install the package via Composer:

composer require chaoswd/laravel-mongo-models

Tested on Laravel 12.x.
Likely compatible with Laravel 10 and 11, but unverified. Requires the mongodb/laravel driver installed.

⚙️ Usage

Generate a MongoDB model using the custom Artisan command:

php artisan make:mongo:model {name} --collection="collectionName"

Example

php artisan make:mongo:model User --collection="users"

This command will create a model at:

app/Models/User.php

with the following structure:

<?php

namespace App\Models;

use MongoDB\Laravel\Eloquent\Model;

class User extends Model
{
    protected $connection = 'mongodb';
    protected $collection = 'users';

    protected $guarded = [];
}

🧩 Features

  • 🔹 Generates MongoDB-compatible Eloquent models
  • 🔹 Uses the official mongodb/laravel driver
  • 🔹 Automatically sets connection and collection properties
  • 🔹 Simple, framework-native syntax

🧰 Requirements

🧾 License

This package is open-sourced software licensed under the MIT License.
© Jordan Gerber DBA Chaos Web Development

🕒 Changelog

See the CHANGELOG.md for version history and release notes.

💬 Contributing

Pull requests are welcome! For major changes, please open an issue first to discuss your ideas.
Please make sure to update tests as appropriate.

Created with 🌀 by Chaos Web Development

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-10-29

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固