Facades
Lumberjack uses the Blast Facades library.
Creating a Facade
Facades provide a simple static API to an object that has been registered into the container. For example to setup a facade you would first use a Service Provider to register an instance of your class into the container:
Then create a Facade subclass and tell it which key to use to retrieve your class instance:
Available Facades
Lumberjack comes with a handful of useful Facades. Below you can see which class the Facade references and what it is bound to the container under.
Config
Rareloop\Lumberjack\Config
config
Log
Monolog\Logger
logger
Router
Rareloop\Lumberjack\Http\Route
router
Session
Rareloop\Lumberjack\Session\SessionManager
session
Example usage
All of Lumberjack's Facades live under the Rareloop\Lumberjack\Facades
namespace.
Config
The Config
facade allows you to get and set values from your config.
Config is also available as a Helper
Log
The Log
facade allows you to use the PSR-3 Logger Monolog.
Router
The Router
facade allows you to create custom routes or get the URLs for your routes.
See Creating Routes for more information.
Session
The Session
facade allows you to retrieve and store data in the current session.
Session is also available as a Helper
Last updated