Laravel 5.3 @extends('layouts.app')返回尝试获取非对象错误的属性

时间:2016-12-09 10:29:03

标签: laravel-5.3

我是laravel的新手。我的页面中出现此错误

  ErrorException in 8afd74a6e1e33743517baf7fe73821f647ea6aa5.php line 69: Trying to get property of non-object (View: /home/vagrant/sites/ocean/resources/views/layouts/app.blade.php) (View: /home/vagrant/sites/ocean/resources/views/layouts/app.blade.php)

index.blade.php文件:

@extends('layouts.app')

StudentsController:

<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;

class StudentsController extends Controller
{
    public function index()
    {
        return view('students.index');

    }
}

1 个答案:

答案 0 :(得分:0)

我在Laravel 5.4中面临同样的问题,搜索了很多,但没有找到任何解决方案,我做了新的布局,然后扩展它并且它有效。

@extends('layouts.newapp')