Skip to content
Discussion options

You must be logged in to vote

The app() helper provides more than just class name binding.

Spoiler

if (! function_exists('app')) {
/**
* Get the available container instance.
*
* @param string|null $abstract
* @param array $parameters
* @return \Illuminate\Contracts\Foundation\Application|\Illuminate\Foundation\Application|mixed
*/
function app($abstract = null, array $parameters = [])
{
if (is_null($abstract)) {
return Container::getInstance();
}
return Container::getInstance()->make($abstract, $parameters);
}
}

In PHPStan, you can have c…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@nadinengland
Comment options

@nadinengland
Comment options

Answer selected by nadinengland
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
None yet
3 participants