Laravel 5.1 View Not Found

This seems to be a problem that occasionally appears in Laravel. I wrote a CRUD controller to use it, but after testing, I received an error InvalidArgumentException in FileViewFinder.php line 137: View [bookingcrud.index] not found . Here is my code:

routes.php:

 Route::resource('bookingcrud', 'BookingsCrudController'); 

BookingsCrudController.php

 use uasc\Http\Requests; use uasc\Http\Requests\CrudCreateRequest; use uasc\Http\Requests\CrudUpdateRequest; use uasc\Http\Controllers\Controller; use Auth; use DB; use Illuminate\Pagination\Paginator; use Illuminate\Http\Request; class BookingsCrudController extends Controller { public function index() { if (!Auth::check() || Auth::user()->authority < 1) { return redirect('/login'); } $raw = "select * from bookings"; $bookings = DB::select($raw); $paginatedBookings = new Paginator($bookings, 1); return view('bookingcrud.index')->with('bookings', $paginatedBookings); } } 

And the view located in ~/laravel/resources/views/bookingcrud/index.blade.php Regardless of what is in this view, will it be markup from the working view or just the word โ€œcheeseโ€:

 InvalidArgumentException in FileViewFinder.php line 140: View [bookingcrud.index] not found. 

I tested the same view in a well-known working controller and got the same error, however I tested a well-known working view on the same CRUD controller and it worked. I also tried changing the view directory and renaming it, but I will get the same error if "View [bookingcrud.index]" changes accordingly. I made sure that the rights to the file and directories were filled in for testing.

From the first error I received, I upgraded to 5.1.1 from 5.0.26 (this is the version with which the error occurred for me) and performed an update for the composer. Also, looking at streams with the same error, I also ran the artisan config: clear command

I am developing Windows 8.1 with Homestead 2.0.17 deployed using Virtual Box.

Any help would be very helpful at this moment when she is doing my head.

+5
source share
4 answers

It turns out that I pronounced the blade incorrectly, took a second pair of eyes to actually notice it.

 vagrant@homestead :~/Development/laravel$ ls resources/views/crud/booking/ 

crud.balde.php index.balde.php

There was definitely a lesson to always check out small things when debugging. Thanks for the help.

+4
source

Please use the terminal

 homestead ssh > Press Enter vagrant@homestead cd /Path_of_Your_Project/ vagrant@homestead :~/Path_of_Your_project php artisan cache:clear vagrant@homestead :~/Path_of_Your_project php artisan config:cache 

sorry for my English

+14
source

For those who do not have access to SSH, there are two ways to solve this problem.

If you donโ€™t have a default plugin for the Laravel package, First, just remove bootstrap / cache / config.php to solve this file.

OR

If you have a default plugin for the Laravel package, change all the associated bootstrap / cache / config.php paths to the exact path that the laravel project has selected.

+2
source

Remember that Linux is case sensitive!

I had something like this:

 return view('MyView', $data); 

And it worked in my environment (Mac OS), but not on the deployment server (Ubuntu)!

+1
source

All Articles