Laravel中不支持的驱动程序MongoDB

时间:2015-10-31 09:47:48

标签: php mongodb laravel

我是MongoLaravel的新手。我一直在关注this教程,当我在控制器中调用all方法时,它给出了错误不支持的驱动程序[mongodb] 下面是我的控制器和型号 控制器:

class homeController extends Controller
{
    /**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
    public function index()
    {
        $users  = \App\Homemodel::all();
      $config_items = \App\Homemodel::getData();
      echo "<pre>";
      print_r($users);
    }

模型

<?php

namespace App;

use Jenssegers\Mongodb\Model as Eloquent;

class Homemodel extends Eloquent
{


    protected $connection   =   'mongodb';

    protected $collection   =   'user';



    public static function getData() {
        echo "in all function";
    }


}

0 个答案:

没有答案