Google News
logo
Laravel - Interview Questions
What do you know about Facades in Laravel? Explain.
Laravel Facades provide static-like interface classes which are available in the application's service container. Laravel self-ships with several available facades, gives access to almost all features of Laravel. Facades also help to access a service directly from the container itself. It is described in the Illuminate\Support\Facades namespace. Hence, it is easy to use.
 
Example :
use Illuminate\Support\Facades\Cache;  
     Route::get('/cache', function () {  
return Cache::get('PutkeyNameHere');  
})

Facades in Laravel

Advertisement