执行下面的指令可以生成index应用的Blog控制器类库文件
>php think make:controller index@Blog如果是单应用模式,则无需传入应用名
>php think make:controller Blog默认生成的是一个资源控制器,类文件如下:
<?phpnamespace app\index\controller;use think\Controller;use think\Request;class Blog{    /**     * 显示资源列表     *     * @return \think\Response     */    public function index()    {        //    }    /**     * 显示创建资源表单页.     *     * @return \think\Response     */    public function create()    {        //    }    /**     * 保存新建的资源     *     * @param  \think\Request  $request     * @return \think\Response     */    public function save(Request $request)    {        //    }    /**     * 显示指定的资源     *     * @param  int  $id     * @return \think\Response     */    public function read($id)    {        //    }    /**     * 显示编辑资源表单页.     *     * @param  int  $id     * @return \think\Response     */    public function edit($id)    {        //    }    /**     * 保存更新的资源     *     * @param  \think\Request  $request     * @param  int  $id     * @return \think\Response     */    public function update(Request $request, $id)    {        //    }    /**     * 删除指定资源     *     * @param  int  $id     * @return \think\Response     */    public function delete($id)    {        //    }}默认生成的控制器类生成了资源操作方法,如果仅仅生成空的控制器则可以使用:
>php think make:controller index@Blog --plain生成的控制器类文件如下:
<?phpnamespace app\index\controller;class Blog{    //}如果需要生成多级控制器,可以使用
>php think make:controller index@test/Blog --plain会生成一个 app\index\controller\test\Blog 控制器类。
可以支持 --api 参数生成用于API接口的资源控制器。
和生成控制器类似,执行下面的指令可以生成index应用的Blog模型类库文件
>php think make:model index@Blog如果是单应用模式,无需传入应用名
>php think make:model Blog生成的模型类文件如下:
<?phpnamespace app\index\model;use think\Model;class Blog extends Model{    //}如果要生成带后缀的类库,可以直接使用:
>php think make:controller index@BlogController>php think make:model BlogModel可以使用下面的指令生成一个中间件类。
>php think make:middleware Auth会自动生成一个 app\middleware\Auth类文件。
可以使用
>php think make:validate index@User生成一个 app\index\validate\User 验证器类,然后添加自己的验证规则和错误信息。