Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

php artisan permission:show uuid error #2581

Closed
NBenzekri opened this issue Dec 23, 2023 · 1 comment · Fixed by #2582
Closed

php artisan permission:show uuid error #2581

NBenzekri opened this issue Dec 23, 2023 · 1 comment · Fixed by #2582
Labels

Comments

@NBenzekri
Copy link

NBenzekri commented Dec 23, 2023

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
drbyte added a commit to drbyte/laravel-permission that referenced this issue Dec 24, 2023
Use `getKeyName()` instead of `'id'`

Fixes spatie#2581
@drbyte drbyte added the bug label Dec 24, 2023
@drbyte
Copy link
Collaborator

drbyte commented Dec 24, 2023

Hi,
Can you test out this fix: #2582

drbyte added a commit that referenced this issue Apr 19, 2024
Use `getKeyName()` instead of `'id'`

Fixes #2581
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants