Vanilo 3 error during configuration - Class App\Models\User must extend or implement Konekt\User\Contracts\User

Viewed 19

I followed the installation guide https://vanilo.io/docs/3.x/installation for vanilo step by step. Once all steps were completed, I tried to start up the development server with php artisan serve and it threw an error:

InvalidArgumentException Class App\Models\User must extend or implement Konekt\User\Contracts\User.

The default user model has been configured to extend the Konekt user model as described in the installation guide:

namespace App;

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


class User extends \Konekt\User\Models\User
{

The boot method in AppServiceProvider contains:

$this->app->concord->registerModel(\Konekt\User\Contracts\User::class, \App\Models\User::class);

The error states that the user model needs to extend or implement a model from Contacts\User, and it does as declared in the Konekt\User\Models:

namespace Konekt\User\Models;

use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Notifications\Notifiable;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Konekt\Enum\Eloquent\CastsEnums;
use Konekt\User\Contracts\Profile;
use Konekt\User\Contracts\User as UserContract;
use Konekt\User\Contracts\Profile as ProfileContract;
use Konekt\User\Events\UserWasActivated;
use Konekt\User\Events\UserWasCreated;
use Konekt\User\Events\UserWasDeleted;
use Konekt\User\Events\UserWasInactivated;

/**
 * User Entity class
 *
 */
class User extends Authenticatable implements UserContract
{

I've followed this installation guide twice over from scratch and it always leads to this error. I need help troubleshooting, as it appears everything is done properly.

1 Answers

Fixed by changing the namespace on the User model to default, despite the tutorial showing namespace App, I used namespace App\Models and that fixed it.

Related