Skip to content

Composer package breaks project when using recommended app()->langPath() method #1221

@halloei

Description

@halloei
  • Lumen Version: 8.3.4
  • Laravel Version: 8.83.1
  • PHP Version: 8.1.2
  • Database Driver & Version: %

Description:

I did not yet upgrade my Laravel and Lumen projects to version 9, but I did prepare my Laravel and Lumen packages for it.
The upgrade guide recommends to set the path for package language files with app()->langPath() instead of hard-coding it. I changed that and did now a simple composer update in my Lumen project (still version 8) and it broke, because its Application class does not contain a langPath() method. I'm surprised version 9 of the framework doesn't either.

Steps To Reproduce:

In your Lumen project, pull in a Laravel/Lumen package with the following service provider:

class MyPackageServiceProvider extends ServiceProvider
{
    public function boot(): void
    {
        $this->publishes([__DIR__ . '/../lang' => $this->app->langPath() . "/vendor/my-package"]);
    }
}

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