Rasshu
Rasshu

Reputation: 1809

InvalidArgumentException, "View not found", on Lumen 5.2.6

Tried clearing the app cache with php artisan cache:clear and the views' cache with baao's ClearViewCache, but it didn't work.

Followed the Basic Task List tutorial from the official docs, there's an empty Task model in /app folder.

The command php artisan --version prints: Laravel Framework version Lumen (5.2.6) (Laravel Components 5.2.*)

______________________________________________________________

The exception message:

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

______________________________________________________________

Screenshot of my project's structure:

enter image description here

Upvotes: 1

Views: 1866

Answers (1)

codedge
codedge

Reputation: 5174

Since release 5.2, the Lumen framework does not support any templating/views anymore, instead it focuses on staless RESTful APIs.

Please see the offical release notes with the following excerpt:

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.

Upvotes: 2

Related Questions