Php 没有模型的查询结果?但是为什么呢?

Php 没有模型的查询结果?但是为什么呢?,php,laravel,model,Php,Laravel,Model,就像标题写的一样,我得到了一个: No query results for model [App\Models\Thread\Comment]. 错误消息。我在尝试删除线程后出现此错误。有趣的是,这个错误消息说“评论模型没有结果。但我不想删除一个线程,而不是一个评论。不管线程是否有评论,我每次尝试都会收到这个错误消息。我真的说不出原因,因为我没有更改评论模型。有人能看一下吗 我的评论模式: <?php namespace App\Models\Thread; use Illumina

就像标题写的一样,我得到了一个:

No query results for model [App\Models\Thread\Comment]. 
错误消息。我在尝试删除线程后出现此错误。有趣的是,这个错误消息说“评论模型没有结果。但我不想删除一个线程,而不是一个评论。不管线程是否有评论,我每次尝试都会收到这个错误消息。我真的说不出原因,因为我没有更改评论模型。有人能看一下吗

我的评论模式:

<?php
namespace App\Models\Thread;

use Illuminate\Database\Eloquent\Model;

class Comment extends Model
{
    public $table = 'comments';
    public $fillable = [
        'comment',
        'thread_id',
        'user_id',
    ];

    public function commentuser()
    {
        return $this->belongsTo('App\User', 'user_id', 'id');
    }
}
螺纹+注释所在的刀片为:

控制器中的distroy方法:

public function destroy($id)
{
    $thread = Thread::query()->findOrFail($id);
    $thread->delete();
    return redirect(action('Test\\TestController@startpage', [Auth::user()->id]));
}

编辑:模型还可以,我试着在另一个刀片上获取我的注释,并获取了所有注释,所以我的模型应该还可以。我还取消注释了从注释模型中获取内容的所有行,但错误仍然存在。您可能应该告诉我们在控制器上的
destrocComment
方法发生了什么。这很奇怪。在某个地方,您必须将您的
注释
模型别名为
线程
。如果您这样做
线程::类
,是否返回
App\Models\Thread\Comment
?在控制器中,您不会执行类似于
使用App\Models\Thread\Comment作为线程的操作;
是吗?如果您尝试将这些cl别名,则另一种想法此外,您可能还需要检查
config/app.php
中的
别名
数组是否正确。
Route::delete('/show/{id}', ['as' => 'destroycomment', 'uses' => 'Test\\TestController@destroycomment']);
public function destroy($id)
{
    $thread = Thread::query()->findOrFail($id);
    $thread->delete();
    return redirect(action('Test\\TestController@startpage', [Auth::user()->id]));
}