[1.x] Fix Add Service as Dependencies of App Service #650
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.then it will issue a warning:
Even though we have given the app service name to the environment as follows:
in the sail file it says APP_SERVICE taken from APP_SERVICE in the environment or laravel.test as the default name.
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.