Vinelab / NeoEloquent

The Neo4j OGM for Laravel
MIT License
633 stars 199 forks source link

I am un able to make model that is connected with neo4j #202

Closed MuddassirPasta closed 7 years ago

MuddassirPasta commented 7 years ago

I was making model as

namespace app;

use Vinelab\NeoEloquent\Eloquent\Model;

class Product extends NeoEloquent {

}

FatalErrorException in Product.php line 7: Class 'App\NeoEloquent' not found

AzeemMichael commented 7 years ago

Try one of these. Solution 1: use Vinelab\NeoEloquent\Eloquent\Model as NeoEloquent; or Solution 2: class Product extends Model

freitasbruno commented 7 years ago

Can also try simply adding a backslash before NeoEloquent class Product extends \NeoEloquent

Mulkave commented 7 years ago

The solutions provided by @AzeemMichael and @freitasbruno works very well.

Also, you may add the service provider 'Vinelab\NeoEloquent\NeoEloquentServiceProvider', to the providers array in config/app.php you should be able to do something like:

namespace app;

use NeoEloquent;

class Product extends NeoEloquent
{

}