1.

What is Laravel facade?

Answer»

LARAVEL facades provide a "static" interface to CLASSES that are available in the application's service container. All of Laravel's facades are defined in Illuminate\Support\Facades namespace. Facades are easy to USE and don’t require injection so we can use many facades in one class. The benefit of using facade class is its expressive syntax, maintaining more testability and flexibility than traditional static methods of classes.

Access facade LIKE:

use Illuminate\Support\Facades\Cache; Route::get('/cache', function () {    RETURN Cache::get('key'); });


Discussion

No Comment Found