webman官方默認(rèn)使用laravel的數(shù)據(jù)庫(kù),但是在使用模型調(diào)用delete()方法 時(shí)候,laravel的 illuminate/database模型刪除方法內(nèi)部有使用DB這個(gè)facade,請(qǐng)問應(yīng)該怎么解決?
本人知道可以使用support\Db
的orm代替,但是如果想繼續(xù)使用模型應(yīng)該怎么辦?
/**
* 刪除
* @param array $data
* @return array
*/
public function delete(array &$data): array
{
if (empty($data['ids'])) {
return $this->error('請(qǐng)選擇要?jiǎng)h除的菜單');
}
MenuModel::query()->whereIn('id', $data['ids'])->delete();
return $this->success();
}
A facade root has not been set.