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

[1.x] Fix Add Service as Dependencies of App Service #650

Conversation

newarifrh
Copy link

Problem

Currently the app service has the default name "laravel.test". When we change the service application according to what we want, several issues will arise. An example of this is when adding additional services as dependencies.

sail artisan sail:add mailpit

then it will issue a warning:

Couldn't find the laravel.test service. Make sure you add mailpit to the depends_on config.

Even though we have given the app service name to the environment as follows:

APP_SERVICE=your_app

in the sail file it says APP_SERVICE taken from APP_SERVICE in the environment or laravel.test as the default name.

export APP_SERVICE=${APP_SERVICE:-"laravel.test"}

Solution

To resolve this issue and prevent warnings during service additions, this pull request introduces a check for the APP_SERVICE environment variable. If APP_SERVICE is absent, the system defaults to 'laravel.test' as the service name. This adjustment ensures smooth dependency addition without unnecessary warnings.

This update aims to enhance the reliability and usability of the Sail environment.

@taylorotwell
Copy link
Member

Thanks for your pull request to Laravel!

Unfortunately, I'm going to delay merging this code for now. To preserve our ability to adequately maintain the framework, we need to be very careful regarding the amount of code we include.

If possible, please consider releasing your code as a package so that the community can still take advantage of your contributions!

If you feel absolutely certain that this code corrects a bug in the framework, please "@" mention me in a follow-up comment with further explanation so that GitHub will send me a notification of your response.

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.

None yet

2 participants