Skip to content

$keyPath must not be accessed before initialization #1814

Closed
@JC5

Description

@JC5

Passport Version

13.0

Laravel Version

12.12

PHP Version

8.4.5

Database Driver & Version

NA

Description

Fresh installation of Laravel + Passport.

Run: php artisan passport:keys. Results in error:

   Error

  Typed static property Laravel\Passport\Passport::$keyPath must not be accessed before initialization

  at vendor/laravel/passport/src/Passport.php:407
    403▕     public static function keyPath(string $file): string
    404▕     {
    405▕         $file = ltrim($file, '/\\');
    406▕
  ➜ 407▕         return static::$keyPath
    408▕             ? rtrim(static::$keyPath, '/\\').DIRECTORY_SEPARATOR.$file
    409▕             : storage_path($file);
    410▕     }
    411▕

      +14 vendor frames

  15  artisan:16
      Illuminate\Foundation\Application::handleCommand()

Steps To Reproduce

composer create-project "laravel/laravel:^12.0" example-app
cd example-app/
composer require laravel/passport
php artisan passport:keys
php -v
history

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions