Selvesan Malakar
Selvesan Malakar

Reputation: 571

Laravel 5.4 View [name] not found

Even if the views is available at the resources/views directory laravel is showing me this error

View [name] not found.

Everything was working fine until a token mismatch error occured currently i am not being able to access any view in the views directory.

Route::get('/', function () {
    return view('welcome');
});//in web.php

is throwing View [welcome] not found. exception

NOTE I am running my application vagrant in homestead

Upvotes: 6

Views: 18741

Answers (5)

sunandan
sunandan

Reputation: 41

none of above answers helped me. Heres what i did. The issue is that laravel cant find new route provided by your in web.php because it is using it from cached routes. So try running this command

php artisan route:cache

This will clear routes cache Hopefully this will solve your issue

Upvotes: 0

UnleashDchaos
UnleashDchaos

Reputation: 475

I had the same issue on the server. The cause was folders inside the view folder has no executable permission. After giving permission to those folders everything works fine.

Upvotes: 0

check your blade syntax, i just fix mine it was

@if
@component
@endif
@endcomponent

Upvotes: 0

Mayank Pandeyz
Mayank Pandeyz

Reputation: 26258

First of all check welcome view exist in the resources/views directory. After that run following command on terminal:

php artisan cache:clear
php artisan config:cache

and refresh the page.

Explanation: Laravel maintains cache to serve view, so you have to clear the cache.

Upvotes: 4

Selvesan Malakar
Selvesan Malakar

Reputation: 571

I was having this problem only when running the application on homestead server and i was able to solve this after i ran the

php artisan config:clear

command

Upvotes: 5

Related Questions