定制 loaikanou/laravel_mongo 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

loaikanou/laravel_mongo

Composer 安装命令:

composer require loaikanou/laravel_mongo

包简介

MongoDB driver, auth, passport, for laravel

README 文档

README

Laravel Package for MongoDB

An Eloquent model and Query builder with support for MongoDB, using the original Laravel API. This library extends the original Laravel classes, so it uses exactly the same methods.

Quick Start Guide

  • Create a Laravel 5.5 project: composer create-project laravel/laravel mongo-project
  • cd mongo-project
  • Add dependency: composer require loaikanou/laravel_mongo
  • Copy configuration: php artisan vendor:publish
  • Run your project: php artisan serve

Now you are ready to use the Mongo Facade, e.g. open routes/web.php:

<?php

Route::get('mongo', function(Request $request) {
    $collection = Mongo::get()->mydatabase->mycollection;
    return $collection->find()->toArray();
});

Route::get('/', function () {
    return view('welcome');
});

Add a document to mycollection in mydatabase and open the browser at http://127.0.0.1:8000

To override the default MongoDB connection configuration add the following parameters to your .env file. Find a detailed description on the MongoDB Driver Manager Page. Use JSON notation within single quotes ' for options.

MONGO_URI=mongodb://127.0.0.1:27017
MONGO_URI_OPTIONS='{"appname": "app", "replicaSet": "repl"}'
MONGO_DRIVER_OPTIONS=

........

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-04-11