Laravel 5-找不到[首页] [英] Laravel 5 - View [home] not found

查看:154
本文介绍了Laravel 5-找不到[首页]的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我运行了composer update,现在遇到了问题.尝试加载主视图时出现此错误:

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

是的,文件存在于我的目录中(资源/视图等).名称是home.blade.php.

我的控制器:

<?php namespace Hulahoop\Http\Controllers;

use Hulahoop\Http\Requests;
use Hulahoop\Http\Controllers\Controller;

use Illuminate\Http\Request;

class HomeController extends Controller {

    /**
     * Display a listing of the resource.
     *
     * @return Response
     */
    public function index()
    {
        return view('home');
    }

}

路线:

Route::get('/', 'HomeController@index');

这很好,它是非常基本的功能.发生了什么?在本地宅基地FYI上运行.

更新:运行php artisan serve时,可以很好地查看主页视图(即在 http上://localhost:8000 ).但是在宅基地上,没有骰子.有什么作用?

解决方案

无业游民和php artisan config:cache似乎存在问题. 如果您运行php artisan config:clear然后尝试打开该页面-您应该会看到它工作正常-只需确保您不通过手工艺者对其进行缓存即可.

I ran composer update and now I'm running into an issue. I'm getting this error when I'm trying to load my home view:

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

Yes, files exists in my directory (resources/views, etc.). Name is home.blade.php.

My controller:

<?php namespace Hulahoop\Http\Controllers;

use Hulahoop\Http\Requests;
use Hulahoop\Http\Controllers\Controller;

use Illuminate\Http\Request;

class HomeController extends Controller {

    /**
     * Display a listing of the resource.
     *
     * @return Response
     */
    public function index()
    {
        return view('home');
    }

}

Route:

Route::get('/', 'HomeController@index');

This was working fine and it's very basic function. What happened? Running on local homestead FYI.

UPDATE: When I run php artisan serve, I can view the home page view fine (i.e. on http://localhost:8000). But on homestead, no dice. What gives?

解决方案

There seem to be a problem with vagrant and php artisan config:cache. If you run php artisan config:clear and then try to open the page - you should see it working fine - just make sure you don't cache it via artisan.

这篇关于Laravel 5-找不到[首页]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆