在 Laravel 上找不到表单的 Class 问题

Problem of Class not found on Laravel for a form

我试图按照本教程在 Laravel 上进行工作:https://vegibit.com/how-to-set-up-form-submission-in-laravel/ but I got a strange bug and I can't found a way to fix it, I wanted to make a form to insert something in my database and show it in another page (the showing is right, it's just the form page that get this problem) here is a screenshot :

代码:

namespace Doreas\Http\Controllers;

use Illuminate\Http\Request;
use App\Demand;
class DemandeController extends Controller
{
    public function index()
    {
        $demande = Demand::all();
        return view('demande.index', ['demande' => $demande]);
    }

    public function show($id)
    {
        $demande = Demande::find($id);
        return view('demande.show', ['demande' => $demande]);
    }

    public function create()
    {
        return 'it works';
    }
}

不明白Demand的问题从何而来

<?php

namespace App\Doreas;

use Illuminate\Database\Eloquent\Model;

class Demand extends Model
{
    public function scopeTest($query)
    {
        return $query->where('title', '=', 'test');
    }
}

我在哪里声明 class

问题是您使用 use App\Demand;

导入了 class Demand

但是它的命名空间实际上是 App\Doreas 所以你应该做 use App\Doreas\Demand;