tilakputta/laravel-make-mongo 问题修复 & 功能扩展

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

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

tilakputta/laravel-make-mongo

Composer 安装命令:

composer require tilakputta/laravel-make-mongo

包简介

Laravel Artisan Make Model command for Mongo Model using Jenssegers/MongoDb

README 文档

README

Release GitHub license Donate

A Composer Package written to generate boiler-plate code of Mongo Model with Jenssegers/MongoDb using Laravel Artisan

Table of contents

Installation

Installation using composer:

composer require tilakputta/laravel-make-mongo

And add the command to commands array in Kernel.php

protected $commands = [
    \TilakPutta\Console\ModelMakeCommand::class
];

Usage

For usage with Artisan type in this command:

php artisan make:model ModelName

Examples

php artisan make:model Models/PermissionRole

creates app/Models/PermissionRole.php

<?php

namespace App\Models;

use Jenssegers\Mongodb\Eloquent\Model;

class PermissionRole extends Model
{
    protected $collection = 'permission_roles';

    protected $fillable = [
        
    ];

    protected $primaryKey = 'id';

    public $incrementing = false;

    /**
     * model life cycle event listeners
     */
    public static function boot(){
        parent::boot();

        static::creating(function ($instance){
            if (!$instance->exists) {
                $instance->id = uniqid();
            }
        });

        static::created(function ($instance){
            
        });
    }
}

Authors

TilakPutta

Contributing

Please make your contributions to make it more useful.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Unknown
  • 更新时间: 2018-10-13

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固