-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Permissions and Role Disapper(empty) from Model after ~10-14 requests #2693
Comments
i tested the API's calls and i tested livewire , on both the issue persists . |
Hi, I don't use octane, and I wouldn't know how to fix it. laravel-permission/src/PermissionServiceProvider.php Lines 95 to 116 in 80a32a1
|
i been trying for two days with no luck )) i tried to ->setPermissionsTeamId(null) and ->clearPermissionsCollection() in octane config listeners but still no luck , same issue . and again this used to work fine on laravel 9 and spatie 5.9 |
You could check what has changed between those versions, maybe the bug is there |
https://github.com/spatie/laravel-permission/compare/671e46e..80a32a1 |
ok an update to the issue , when the teams=>false in permission config file is set there is no problem . |
It seems that you did not read my initial comment, I specified where in the code that happened(Also #2545) It seems that you did not follow the documentation, the middleware is supposed to put the team_id again in each request |
Description
ok guys i been looking for this issue for two days already and can not find the problem i am using laravel 11 with octane (roadrunner) all the latest versions (fresh install) , i got jetstream as well , and spatie permissions with teams ON . so during requesting my user model with permissions and roles , i get the data and everything is good , after around 14 requests in a row , the role and permissions from user Model becomes empty , i tried to use " setPermissionsTeamId('1')" almost everywhere ( routes, in __construct of the controller and in the method of the controller , nothing helped , i tried to flush in octane settings in "OperationTerminated" also did not help , keep notice that in artisan serve mode it works fine , so it seems something with octane is the issue or with this package , if anything , i am trying to upgrade my project from laravel 10 to laravel 11 , which in it i have this package ( version 5.9 ) and older octane and laravel 10 , and it is working fine no issues with it .
Steps To Reproduce
1.clone the repo , then - docker compose build ( sorry for the long build time , all the extentions are needed )
2.docker compose up
3.postman ( post request to (http://0.0.0.0:8081/api/login ) ) get the token , user can be found in seeder RolesAndPermissionsSeeder
4.GET request to (http://0.0.0.0:8081/api/permissions ) not to forget to add Bearer Token in header
Example Application
https://github.com/jihadismail8/OctaneSpatie
Version of spatie/laravel-permission package:
6.9
Version of laravel/framework package:
11
PHP version:
8.3
Database engine and version:
sqlite
OS: Windows/Mac/Linux version:
ubuntu 22
The text was updated successfully, but these errors were encountered: