src/Defender/Traits/Users/HasRoles.php
public function roles()
    {
        $roleModel = config('defender.role_model', 'Artesaos\Defender\Role');
        $roleUserTable = config('defender.role_user_table', 'role_user');
        $roleKey = config('defender.role_key', 'role_id');

        return $this->belongsToMany($roleModel, $roleUserTable, 'user_id', $roleKey);
    }
public function roles()
    {
        $roleModel = config('defender.role_model', 'Artesaos\Defender\Role');
        $roleUserTable = config('defender.role_user_table', 'role_user');
        $roleKey = config('defender.role_key', 'role_id');

        return $this->belongsToMany($roleModel, $roleUserTable, 'user_id', $roleKey);
    }
public function roles ( ) { $ roleModel = config ( 'defender.role_model' , 'Artesaos\Defender\Role' ) ; $ roleUserTable = config ( 'defender.role_user_table' , 'role_user' ) ; $ roleKey = config ( 'defender.role_key' , 'role_id' ) ; return $ this -> belongsToMany ( $ roleModel , $ roleUserTable , 'user_id' , $ roleKey ) ; }
Many-to-many role-user relationship.

@return \Illuminate\Database\Eloquent\Relations\BelongsToMany
Many - to - many role - user relationship .