I'm having a problem using the MongoDB with Laravel framework. I used this Laravel-MongoDB
Here's the error I got
/app/model/User.php
<?php
use Jenssegers\Mongodb\Model as Eloquent;
class User extends Eloquent {
//protected $connection = 'mongodb';
protected $collection = 'users';
$user = User::all();
public function all()
{
return $this->$user;
}
}
?>
/app/routes.php
Route::get('users', function()
{
$users = User::all();
return View::make('users')->with('users',$users);
});
/app/config/database.php
'mongodb' => array(
'driver' => 'mongodb',
'host' => 'localhost',
'port' => 27017,
'username' => 'username',
'password' => 'password',
'database' => 'users'
),
I don't know what's wrong with my implementation. Please help me guys..