Skip to content

php artisan optimize failing to detect PermissionRegistrar #2856

@astoianflygo

Description

@astoianflygo

Description

Hello after a few months out of the my current project, i recreantly started work again

When the features were ready merged for deploy but on the staging server ubuntu running php 8.3
the "php artisan optimize" command started giving this error:

   INFO  Caching framework bootstrap, configuration, and metadata.

  config .............................................................................................................................. 27.34ms FAIL

In Container.php line 841:

  Spatie\Permission\PermissionRegistrar


In CacheManager.php line 106:

  Cache store [none] is not defined.

From what i could gather it only happens when APP_ENV=staging
if I change it to APP_ENV=develop | local | production it works just fine

just as a mention my other packages are
"require": {
"php": "^8.3",
"barryvdh/laravel-dompdf": "^3.1.1",
"diglactic/laravel-breadcrumbs": "^10.0",
"giggsey/libphonenumber-for-php-lite": "^8.13",
"guzzlehttp/guzzle": "^7.0",
"laravel-validation-rules/credit-card": "^1.9",
"laravel/framework": "^12.0",
"laravel/sanctum": "^4.0",
"laravel/tinker": "^2.7",
"livewire/livewire": "^3.6.3",
"maatwebsite/excel": "^3.1",
"mhmiton/laravel-modules-livewire": "^5.1.0",
"nwidart/laravel-modules": "^11.1",
"opcodesio/log-viewer": "^3.11",
"openai-php/client": "^0.10.1",
"spatie/laravel-ignition": "^2.0",
"spatie/laravel-permission": "^6.4"
},

Steps To Reproduce

  1. conect to server
  2. navigate project root
  3. have APP_ENV=staging
  4. run "php artisan optimize" or "php artisan config:cache"

Example Application

No response

Version of spatie/laravel-permission package:

6.20.0

Version of laravel/framework package:

12

PHP version:

8.3.4

Database engine and version:

mysql

OS: Windows/Mac/Linux version:

ubuntu

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions