spatie/laravel-permission

There is no permission named `admin.create` for guard `sanctum`.

islamyearul opened this issue · 2 comments

Describe the bug
I used Jetstream Auth System. When I create role and assign permission there have show this error. but in my Seeder file create successfully.
Spatie \ Permission\ Exceptions\ PermissionDoesNotExist.
There is no permission named admin.create for guard sanctum.

Versions
"php": "^8.0.2",
"guzzlehttp/guzzle": "^7.2",
"laravel/framework": "^9.19",
"laravel/jetstream": "^2.12",
"laravel/sanctum": "^3.0",
"laravel/tinker": "^2.7",
"livewire/livewire": "^2.5",
"spatie/laravel-permission": "^5.7"

PHP version: 8.1.6

Database version:
Apache/2.4.53 (Win64) OpenSSL/1.1.1n PHP/8.1.6
Database client version: libmysql - mysqlnd 8.1.6
PHP extension: mysqli Documentation curl Documentation mbstring Documentation
PHP version: 8.1.6

To Reproduce

Environment (please complete the following information, because it helps us investigate better):

  • Windows 11, 64-bit

Role and permission must have the same guard name

Yeah, I checked my database , You are right when i create role here is store in Sanctum guard. I hope Now I fixed This.
Thanks for suggest me