0

我使用 Laravel 5.2 在本地开发了一个网站。所有功能都运行良好。但是当我把它上传到godaddy服务器时,除了雄辩之外,所有功能都在工作。插入、更新、删除所有作品。但在数据库引擎中,它显示的是 MISAM。我在 INNODB 中更改它。但仍然雄辩不工作。是foreign_key约束的问题吗?错误是 eloquent 变量没有获取数据。怎么解决??

错误:

<body>
    <div id="sf-resetcontent" class="sf-reset">
        <h1>Whoops, looks like something went wrong.</h1>
        <h2 class="block_exception clear_fix">
            <span class="exception_counter">1/1</span>
            <span class="exception_title"><abbr title="Symfony\Component\Debug\Exception\FatalErrorException">FatalErrorException</abbr> in <a title="/home/abhaymilestogo/public_html/floorstyler/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php line 797" ondblclick="var f=this.innerHTML;this.innerHTML=this.title;this.title=f;">Model.php line 797</a>:</span>
            <span class="exception_message">Class &#039;\App\Model\organization&#039; not found</span>
        </h2>
        <div class="block">
            <ol class="traces list_exception">
                <li> in <a title="/home/abhaymilestogo/public_html/floorstyler/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php line 797" ondblclick="var f=this.innerHTML;this.innerHTML=this.title;this.title=f;">Model.php line 797</a></li>
            </ol>
        </div>
    </div>
</body>

代理刀片.php

<tr>
    <th>{{$agency['id']}}</th>
    <th>{{$agency['name']}}</th>
    <th>{{$agency->organization->name}}</th>
    <th>{{$agency['status']}}</th>
    <th>{{$agency['updated_at']}}</th>
    <th>{{$agency['created_at']}}</th>
    <th>
        <a style="font-size: medium;" class="fa fa-pencil-square-o" href="agency/edit/{{$agency['name']}}/{{Crypt::encrypt($agency['id'])}}"></a>

        <a style="font-size: medium;" class="fa fa-trash-o" id="{{Crypt::encrypt($agency['id'])}}"></a>
        @if($agency['status'] == 'ALIVE')
            <a style="font-size: medium;" class="fa fa-times" id="{{Crypt::encrypt($agency['id'])}}"></a>
        @else
            <a style="font-size: medium;" class="fa fa-check" id="{{Crypt::encrypt($agency['id'])}}"></a>
        @endif

    </th>
</tr>
@endforeach

问题出在 {{$agency->organization->name}}

4

1 回答 1

1

该错误清楚地表明找不到 Class \App\Model\organization。

请检查您是否在模型类“组织”中定义了命名空间,并验证您指定的路径是否正确。

此外,最好始终以首字母大写来命名您的类。

如果这不能解决错误,请发布文件 Agency.blade.php。

于 2016-12-09T11:08:49.673 回答