Skip to content

Unable to migrate database after change to Laravel passport #133

@Kuzuto

Description

@Kuzuto

With a fresh project, the php artisan migrate is not possible. Error in the Role table:

Migrating: 2019_04_20_130706_setup_role_permissions

Spatie\Permission\Exceptions\RoleDoesNotExist : There is no role named admin.

at /home/vagrant/code/laravue/vendor/spatie/laravel-permission/src/Exceptions/RoleDoesNotExist.php:11
7| class RoleDoesNotExist extends InvalidArgumentException
8| {
9| public static function named(string $roleName)
10| {

11| return new static("There is no role named {$roleName}.");
12| }
13|
14| public static function withId(int $roleId)
15| {

Exception trace:

1 Spatie\Permission\Exceptions\RoleDoesNotExist::named()
/home/vagrant/code/laravue/vendor/spatie/laravel-permission/src/Models/Role.php:87

2 Spatie\Permission\Models\Role::findByName()
/home/vagrant/code/laravue/database/migrations/2019_04_20_130706_setup_role_permissions.php:22

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions