Skip to content

Sometimes EncryptionServiceProvider not getting configs form .env "No application encryption key has been specified" error! #4975

@ss-koshala

Description

@ss-koshala
  • Laravel Version: 9.37.0
  • Nova Version: 4.17.1
  • PHP Version: 8.0.13
  • Database Driver & Version: MySQL 5.7.36
  • Operating System and Version: Windows 11
  • Browser type and version: Chrome
  • Reproduction Repository: https://github.com/###/###

Description:

Sometimes EncryptionServiceProvider not getting configs form .env
$config = $app->make('config')->get('app');
here $config not getting from .env file. So key filed empty and getting "No application encryption key has been specified" error.

Detailed steps to reproduce the issue on a fresh Nova installation:

In laravel nova admin load "View" on a resource, that resource should have relation fields like, HasOne, or HasMany or any other relation field. And then go to the "view". like this "admin/resources/members/1#Documents=nda" and reload multiple times, we can see console errors.

nova-api/hotel-reservations?search=&filters=W10%3D&orderBy=&perPage=5&trashed=&page=1&viaResource=members&viaResourceId=1&viaRelationship=hotelReservations&relationshipType=hasMany

"nova-api/roles/actions?viaResource=users&viaResourceId=2&viaRelationship=roles&relationshipType=morphToMany&display=index"
like this.

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