Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Laravel 5 view not found

I'm having the weirdest error in Laravel 5, and I haven't had this happen in any of my other projects.

Problem

I receive the following error when I try to hit my app

No such file or directory (View: /home/vagrant/Code/resources/views/layout/master.blade.php) (View: /home/vagrant/Code/resources/views/layout/master.blade.php)

However, in my directory structure

it definitely exists!

And in my blade template

@extends('layout.master')

@section('content')
jfoewifjewo[ij
@endsection

In my controller

public function index()
    {
        return view('home');
    }

Anyone else hit this issue? I've never encountered it before. Yes storage has read/write on both local and homestead.

UPDATE: I'm on Laravel 5.0.13

like image 758
Zarathuztra Avatar asked Feb 28 '15 22:02

Zarathuztra


2 Answers

This issue lies with using Laravel Elixir with homestead. I went back to MAMP to see if I got the same error and what it told me was that I was missing the rev-manifest.json file in public/build. After some digging, I found out that if you don't apply the "versions" function to the elixir function in your gulpfile, the build folder won't be generated and calls to the "elixir" function in your blade templates will fail. This appears to bubble up as an error in finding the view, when it's actually an issue finding a view dependency.

Use gulp to build your sass or less files for sure, but for the time being stick with just URL::asset() to get your javascript and css file paths generated until all the kinks with elixir are worked out.

like image 143
Zarathuztra Avatar answered Sep 20 '22 02:09

Zarathuztra


This is a well know version issue Laravel 5.0.1 (@Zarathuztra version) Here is some comments about the issue: https://laracasts.com/discuss/channels/general-discussion/laravel-5-error-out-of-the-box-with-update-route-throws-an-error

Search for "PratyushPundir" and from them you will see some people having the same issue

Updating Laravel should fix it.

like image 36
Leandro Papasidero Avatar answered Sep 22 '22 02:09

Leandro Papasidero