Skip to content
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

[5.7] Allow the app path to be configured #27332

Merged
merged 1 commit into from
Jan 28, 2019
Merged

[5.7] Allow the app path to be configured #27332

merged 1 commit into from
Jan 28, 2019

Conversation

rojtjo
Copy link
Contributor

@rojtjo rojtjo commented Jan 28, 2019

In my recents projects I'm using a different structure and I noticed I was not able to change the app path without subclassing the Application class.

This change allows the app path to be configured just like the database, environment and storage paths.

The reason I did not add a test for this method is because I could not find any tests for the other methods. If needed I'm happy to add them.

@taylorotwell taylorotwell merged commit 39b40de into laravel:5.7 Jan 28, 2019
@BassemN
Copy link
Contributor

BassemN commented Jan 29, 2019

Thanks a lot for that feature 👍
Is there any documentation for how using this feature?

@rojtjo
Copy link
Contributor Author

rojtjo commented Jan 29, 2019

The actual method was renamed to useAppPath. (see d73e672)

The way I use it is by calling it in the bootstrap/app.php (https://github.com/laravel/laravel/blob/master/bootstrap/app.php) file directly after the Application instance is created.

$app = new Illuminate\Foundation\Application(
    $_ENV['APP_BASE_PATH'] ?? dirname(__DIR__)
);

$app->useAppPath(__DIR__ . '/../src/App');

@BassemN
Copy link
Contributor

BassemN commented Jan 29, 2019

@rojtjo Many thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants