Laravel facades

What are laravel facades?

Laravel Facades provides a static like interface to classes that are available in the application’s service container. Laravel self ships with many facades which provide access to almost all features of Laravel’s . Laravel facades serve as “static proxies” to underlying classes in the service container and provides benefits of a terse, expressive syntax while maintaining more testability and flexibility than traditional static methods of classes. All of Laravel’s facades are defined in the IlluminateSupportFacades namespace. You can easily access a facade like so:


use IlluminateSupportFacadesCache;

Route::get('/cache', function () {
return Cache::get('key');
});

Here is Step by step guide to create custom Facade in Laravel 5.4

Top Laravel Interview questions and answers for Fresher and Experienced 

Leave a Reply

Your email address will not be published. Required fields are marked *