Search

Laravel Application Helper: app

November 20, 2016 —John Koster

app($make = null, $parameters = [])

The app function provides access to the Illuminate\Container\Container instance. Because Container is a singleton, any call to app() will return the same Container instance.

The app function can also be used to resolve registered dependencies from the Container instance. For example, to return an instance of the Illuminate\Auth\AuthManager class (the class behind the Auth facade), invoke app with the auth argument:

1<?php
2 
3// $authManager will be an instance of
4// Illuminate\Auth\AuthManager
5$authManager = app('auth');