I have this version: Lumen (5.2.6) (Laravel Components 5.2.*)
Asked
Active
Viewed 6,717 times
1 Answers
10
It's installed by default.
$app->get('/', function () use ($app) {
return $app->make('view')->make('welcome');
});
Make a file /resources/views/welcome.blade.php
to see it works.
UPDATE
In Lumen 5.5, you can do this:
$router->get('/', function () use ($router) {
return $router->app->make('view')->make('welcome');
});

krisanalfa
- 6,268
- 2
- 29
- 38
-
3thanks @Krisan Alfa Timur, but I got a better way ```$app->get('/', function () use ($app) { return view('welcome'); });``` – Alex Quintero Apr 14 '16 at 14:58
-
2Yes, it can. But accessing view via `$app->make('view')` is slightly faster than using `view` function. – krisanalfa Apr 15 '16 at 05:54