laravel-permission
laravel-permission copied to clipboard
php artisan permission:show uuid error
Describe the bug
The issue appears when we're using uuid instead of the id as primary key for spatie models. and when we try to execute php artisan permission:show we got this error:
Guard: web
Illuminate\Database\QueryException
SQLSTATE[42703]: Undefined column: 7 ERROR: column "id" does not exist
LINE 1: select "name", "id" from "permissions" where "guard_name" = ...
^ (SQL: select "name", "id" from "permissions" where "guard_name" = web order by "name" asc)
Versions
- spatie/laravel-permission package version: ^6.1
- laravel/framework package: 9.19
PHP version: 8.2.12
Database version: PostgreSQL 12.17 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 13.2.1 20231011 (Red Hat 13.2.1-4), 64-bit
To Reproduce
Steps to reproduce the behavior: run php artisan permission:show
Environment (please complete the following information, because it helps us investigate better):
- OS: Edition Windows 11 Home Version 22H2 OS build 22621.2861
Hi, Can you test out this fix: https://github.com/spatie/laravel-permission/pull/2582