-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Fatal memory issue when using permission names #2829
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
Comments
Can you post the actual memory error? Sometimes developers have very high memory limits in dev environment but too low limits in their production server configuration. |
This is the actual error getting in logs I'm using application in a docker container having config file same for both prod and dev with 1024M memory_limit |
Peculiar. How many records are in these tables? |
model_has_roles= 1924 |
Another thing to note is that I'm using team permissions creating role for each team. |
maybe #2444 |
Description
Laravel version= 11
Package version= 6
php version = 8.2
I'm facing fatal memory issue when I pass permission in string to any method and all my controllers return 500 error on production with load balancer having redis as cache driver.
$workspaceAdminRole->givePermissionTo(['workspace view']);
However, this works fine
$workspaceAdminRole->givePermissionTo([Permission::where('name', 'workspace.view')->first()]);
same fatal memory error is occurs for the controller middleware
$this->middleware('permission:workspace.list')->only('index');
Am I missing something for production env?
Steps To Reproduce
...
Example Application
No response
Version of spatie/laravel-permission package:
6
Version of laravel/framework package:
11
PHP version:
8.2
Database engine and version:
MySQL
OS: Windows/Mac/Linux version:
Linux Ubuntu
The text was updated successfully, but these errors were encountered: