11

I need to build a small widget, and was planning to use the Lumen for this because I need a quick response and I need components such as routing, translation, requests and views. the problem is noticed now that the views were discontinued after version 5.1.

Is it possible to use views in more recent versions of Lumen?

Richard
  • 39,052
  • 6
  • 25
  • 29
Miguel Borges
  • 7,549
  • 8
  • 39
  • 57

1 Answers1

20

While Lumen 5.2.0 originally stripped out views, they were added back in in Lumen 5.2.1, and have been available since. You should be able to use views without an issue.

resources/views/test.blade.php:

Hello, world!

routes.php:

$app->get('/', function () use ($app) {
    return view('test');
});
patricus
  • 59,488
  • 15
  • 143
  • 145
  • 6
    @MarceloBonus They may not be in the documentation, but `illuminate/view` is [required by the lumen framework](https://github.com/laravel/lumen-framework/blob/5.3/composer.json#L38), and the [`view()` helper is available](https://github.com/laravel/lumen-framework/blob/5.3/src/helpers.php#L348-L367), as well. [This issue](https://github.com/laravel/lumen-framework/issues/456) complains about the missing of documentation on views, and says they're open to PRs if you want to add it back in. – patricus Dec 15 '16 at 05:07