For performance reasons, Lumen does not register facades and service providers the way Laravel does. While Laravel's facades are included in Lumen, only some of them are smooth ( View not one of them), and only if you uncomment the line $app->withFacedes(); in bootstrap/app.php (you can check Laravel\Lumen\Application::withFacades to find out which ones). Therefore, in order to use other facades, such as View , you need to either independently execute the facade class:
// "bootstrap/app.php" is a good place to add this class_alias('Illuminate\Support\Facades\View', 'View');
Or you can enable it with use where necessary:
use Illuminate\Support\Facades\View;
source share