类App \ Http \ Request \ CreatePost不存在

时间:2019-10-04 12:33:41

标签: php laravel-5

此CreatePost.php

<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class CreatePost extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'title' => 'required|string',
            'content' => 'required',
        ];
    }
}

有人请帮助我吗?类App \ Http \ Request \ CreatePost不存在 谢谢

1 个答案:

答案 0 :(得分:0)

您需要在顶部导入模型 例如

use App\Supplier;