InvalidArgumentException,"View not found",关于 Lumen 5.2.6

InvalidArgumentException, "View not found", on Lumen 5.2.6

尝试使用 php artisan cache:clear 清除应用程序缓存并使用 baao's ClearViewCache 清除视图缓存,但没有成功。

按照官方文档中的Basic Task List教程,/app 文件夹中有一个空的任务模型。

命令php artisan --version 打印:Laravel 框架版本 Lumen (5.2.6) (Laravel Components 5.2.*)

______________________________________________________________

异常信息:

InvalidArgumentException in FileViewFinder.php line 137:

View [tasks] not found.

  1. in FileViewFinder.php line 137
  2. at FileViewFinder->findInPaths('tasks', array('/home/rodrigo/Laravel/lumen/resources/views')) in FileViewFinder.php line 79
  3. at FileViewFinder->find('tasks') in Factory.php line 165
  4. at Factory->make('tasks', array('tasks' => object(Collection)), array()) in helpers.php line 332
  5. at view('tasks', array('tasks' => object(Collection))) in routes.php line 22
  6. at Closure->{closure}()
  7. at call_user_func_array(object(Closure), array()) in Container.php line 507
  8. at Container->call(object(Closure), array()) in RoutesRequests.php line 505
  9. at Application->callActionOnArrayBasedRoute(array(true, array(object(Closure)), array())) in RoutesRequests.php line 479
  10. at Application->handleFoundRoute(array(true, array(object(Closure)), array())) in RoutesRequests.php line 376
  11. at Application->Laravel\Lumen\Concerns{closure}() in RoutesRequests.php line 629
  12. at Application->sendThroughPipeline(array(), object(Closure)) in RoutesRequests.php line 382
  13. at Application->dispatch(null) in RoutesRequests.php line 327
  14. at Application->run() in index.php line 28

______________________________________________________________

我的项目结构截图:

自 5.2 版以来,Lumen 框架不再支持任何 templating/views,而是专注于过时的 RESTful API。

请参阅 offical release notes 和以下摘录:

Lumen 5.2 represents a shift on slimming Lumen to focus solely on serving stateless, JSON APIs. As such, sessions and views are no longer included with the framework. If you need access to these features, you should use the full Laravel framework. Upgrading your Lumen application to the full Laravel framework mainly involves copying your routes and classes over into a fresh installation of Laravel. Since Laravel and Lumen share many of the same components, your classes should not require any modification.