Closed tobyl closed 3 years ago
A small note regarding 2.0: all the modules are stable 2.0.0, the Framework layer isn't stable yet, but it is in a working state (I'm also working with it right now on a project).
As far as I see the problem in your case is that you apparently have both App\Models\User
and App\User
.
Can you check that?
Thank you for the response! It's a fresh install of laravel 8 with no modifications done other than what was required to install Vanilo, there is a single model at app/Models/User.php
. I "believe" that I had enabled the built in auth and it worked before doing the modifications for Vanilo.
Edit: Apologies, just noticed a typo in the original post - the first line of the User class is inaccurate, it was the lines recommended in the Vanilo docs - I tried both simple and flexible methods.
Do you use the correct class in the AppServiceProvider::boot
method?
If your app's user model is App\Models\User
, then you need to tell concord to use that model:
$this->app->concord->registerModel(\Konekt\User\Contracts\User::class, \App\Models\User::class);
Ah, that was it - thank you so much for this, I'm still learning how a lot of these pieces fit together!
This Concord "register model" thingy is basically an alternative solution to the configuration based model replacement.
Examples of the configuration based model replacement:
Concord proxies can do a bit more than that, but those features are rather useful for package developers.
If you're only developing your application, then consider the registerModel()
call as a "do it once forget it afterwards"
way that tells the underlying libraries that your application is using the given model.
Do you use the correct class in the
AppServiceProvider::boot
method?If your app's user model is
App\Models\User
, then you need to tell concord to use that model:$this->app->concord->registerModel(\Konekt\User\Contracts\User::class, \App\Models\User::class);
then in the docs it should be noted that in case of a fresh laravel 8 install this should be in the boot method..
It's noted in the docs :wink: https://vanilo.io/docs/2.x/installation#step-3-register-the-model
It only says about App\User but not App\Models\User
Hello, I have a fresh install of Laravel 8 and I'm trying to get Vanilo running (I understand that version 8 isn't fully supported yet).
After following the instructions, I see the error:
I have tried both the simple and flexible methods.
In my composer.json:
My User model:
I have also tried
Konekt\User\Contracts\User
as the path to extend.Any guidance greatly appreciated!