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

Conversation

Projects
None yet
3 participants
@rojtjo
Copy link
Contributor

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

2 checks passed

continuous-integration/styleci/pr The analysis has passed
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@BassemN

This comment has been minimized.

Copy link
Contributor

BassemN commented Jan 29, 2019

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

@rojtjo

This comment has been minimized.

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

This comment has been minimized.

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