dimanche 24 juillet 2016

MongoDB Package Alias doesn't work for Laravel 5.2

I want to use MongoDB Package for Laravel ... (Jenssegers)

I installed that, After I added Provide & Alias (config/app.php) ..., Then I put a MongoDB Driver for Laravel & put Default Driver in (config/database.php).

So, I wanted to test it. I created a 'Post' Model & put these in that :

namespace App;
use Moloquent;

class Post extends Moloquent{
    protected $connection = 'Posts';
}

& In my controller I wrote these ... :

namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Http\Requests;
use App\Post;
class WelcomeController extends Controller{
    public function getPosts() {
        $posts = Post::all();
        return view('welcome', compact('posts'));         
}}

I have done these from a tutorial ..., But I get this error :

ErrorException in AliasLoader.php line 66:

Class 'Jenssegers\Mongodb\Model' not found



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2anZTdn
via IFTTT

Aucun commentaire:

Enregistrer un commentaire