chandy
1 week ago

Make Sanctum tenant aware

Posted 1 week ago by chandy

Am doing an API using Laravel Sanctum and stancl/tenancy and am able to generate an accesstoken, but when i pass it to a protected route I get an error, the personal_access_tokens table is in the migrations/tenant directory, same as the users table. the error am getting its as if auth:sanctum middleware is trying to find the personal_access_tokens table in the migrations folder.

Undefined table: 7 ERROR: relation "personal_access_tokens" does not exist LINE 1: select * from "personal_access_tokens" where "personal_acces... ^ (SQL: select * from "personal_access_tokens" where "personal_access_tokens"."id" = 6 limit 1) {"exception":"[object] (Illuminate\\Database\\QueryException(code: 42P01): SQLSTATE[42P01]: Undefined table: 7 ERROR: relation \"personal_access_tokens\" does not exist LINE 1: select * from \"personal_access_tokens\" where \"personal_acces... ^ (SQL: select * from \"personal_access_tokens\" where \"personal_access_tokens\".\"id\" = 6 limit 1) at C:\\laragon\\www\\tenancy-test\\vendor\\laravel\\framework\\src\\Illuminate\\Database\\Connection.php:671)

Thats the error am getting

Please sign in or create an account to participate in this conversation.