statamic/collaboration

Call to undefined method App\Models\User::name()

Closed this issue · 4 comments

Hi folks. I'm trying out this package and the installation seem to be ok. But the UI gets stuck trying to connect to the socket.

image

Checking the network I can see that the /broadcasting/auth request is failing do to Call to undefined method App\Models\User::name().

I'm using the Eloquent Driver for the users and here's my configs:

// app/Models/User.php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
use Laravel\Sanctum\HasApiTokens;

class User extends Authenticatable
{
    use HasApiTokens, HasFactory, Notifiable;

    // ...
}
// config/auth.php

'providers' => [
        'users' => [
            'driver' => 'eloquent',
            'model' => App\Models\User::class,
        ],
]
//config/statamic/users.php

'repository' => 'eloquent',

I tried extending the User model from Statamic\Auth\Eloquent\User but this brought my server down.

I'm experiencing the same issue, any updates yet?

@MtDalPizzol Have you by any chance found a solution to this problem?

@MtDalPizzol Have you by any chance found a solution to this problem?

Nope. I haven't worked on it anymore...

@jasonvarga @jackmcdade @jesseleite @duncanmcclean Sorry to ask you all, but is this something that comes through eloquent Users in combination with Collaboration addon? I have the exact same issue as described above. I can add

public function name() {
    return $this->name;
    } 

but that causes other problems with registration and also requires id, initials, etc. to be added in this way. So don't think that is a proper solution. Looking forward to hear from you, since now I'm not able to use the Collaboration addon.