Skip to content
关注公众号,获取新课通知

删除相册分类


控制器 app/controller/admin/ImageClass.php

php
public function delete($id)
{
    $imageClass = $this->request->Model;
    return showSuccess($imageClass->delete());
}

验证器 app/validate/admin/ImageClass.php

php
// 验证规则
protected $rule = [
    ...
    'id'=>'require|integer|>:0|isExist:ImageClass',
    ...
];

protected $scene = [
    ...
    'delete'=>['id'],
];

路由 router/admin.php

php
Route::delete('imageclass/:id','admin.ImageClass/delete');