Class 'Role' not found

I am creating a custom user package for use in Laravel 4.

I am running in to a little difficulty setting up my relationship in the User model. Here is the relationship:

public function roles()
{
    return $this->belongsToMany('Role');
}

Now, for some reason this is resulting in a Class 'Role' not found error. Everything in src/models gets auto-loaded via composer in the composer.json file for that package:

"classmap": [
        "src/migrations",
        "src/controllers",
        "src/models",
        "src/repositories"
    ],

Any suggestions?

(I have tried the obvious composer dump-autoload, composer update etc.)


ANSWERS:


return $this->belongsToMany('Role'); is just a string

so you needed the full path like this:

return $this->belongsToMany('path\to\Models\Role');


Ok, so I managed to figure it out, I needed to reference the full namespace of the Role model in the relationship as per the below:

public function roles()
{
    return $this->belongsToMany('Vendor\Package\Model\Role');
}


 MORE:


 ? Laravel 4 custom package not appearing in autoload_namespace.php
 ? Laravel 5 - Creating Artisan Command for Packages
 ? Laravel 5 - Creating Artisan Command for Packages
 ? Laravel 5 - Creating Artisan Command for Packages
 ? Create artisan commands for package Laravel 5
 ? How to call Model via artisan command in Laravel 5?
 ? Laravel 5 php artisan not running in Vagrant, missing vendor/services.json?
 ? Laravel 5 php artisan not running in Vagrant, missing vendor/services.json?
 ? Laravel 5 php artisan not running in Vagrant, missing vendor/services.json?
 ? How to use composer, artisan ...(Laravel) php commands manually