我使用Laravel 5.2在本地开发了一个网站。所有功能都完美无缺。但是当我将它上传到godaddy服务器时,所有功能都在工作,除了雄辩。插入,更新,删除所有作品。但在数据库引擎中它显示了MYISAM。我在INNODB中更改了它。但仍然雄辩不起作用。这是foreign_key约束的问题吗?错误是雄辩的变量没有得到数据。如何解决?
错误:
<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 '\App\Model\organization' 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>
agency.blade.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-&gt; organization-&gt; name}}
答案 0 :(得分:1)
错误明确指出未找到Class \ App \ Model \ organization。
请检查您是否在Model类的“组织”中定义了命名空间,并验证您指定的路径是否正确。
此外,总是使用首字母大写来命名您的类是一个好习惯。
如果这不能解决错误,请发布文件agency.blade.php。