Closed mervinz closed 3 years ago
Have you ran php artisan voyager:install
?
Hi all, I do have the exact same issue. (First time I’m using voyager)
I did run php artisan voyager:install --with-dummy
When trying to create new admin account:
BadMethodCallException
Call to undefined method App\Models\User::setRole()
The user is indeed created with a role_id set up to null instead of 1 (admin).
When trying to access the login panel :
BadMethodCallException
Call to undefined method App\Models\User::hasPermission()
My info : Laravel 8.15 Voyager: v1.4 PHP: 7.4.12
Have you ran
php artisan voyager:install
?
Hello @ryancatlin , Yes I have followed the installation steps. I have tried in a new project using laravel breeze for auth scaffolding and voyager works fine. However, when I use laravel Jetstream this error occurs.
Call to undefined method App\Models\User::hasPermission()
Means Voyager has not been properly installed.
If you are installing Voyager 1.4.2 on Laravel 8, Voyager is not going to find User model and you should see this message at the end of install process:
Unable to locate "User.php" in app or app/Models. Did you move this file? You will need to update this manually. Change "extends Authenticatable" to "extends \TCG\Voyager\Models\User" in your User model
To solve the problem you need to follow instructions or install dev branch, to be noted that Laravel 8 is still not fully supported and there are problems with seeders.
If that does not help we can reopen this issue.
This issue has been automatically locked since there has not been any recent activity after it was closed. If you have further questions please ask in our Slack group.
Version information
Description
I have installed voyager successfully in a new project however, am unable to create admin user account. The below error is displayed when I try to access the admin panel.
BadMethodCallException Call to undefined method App\Models\User::hasPermission()
Steps To Reproduce
Steps to reproduce the behavior:
Screenshots