keywords
parent
9a070e84d6
commit
61cfba421a
|
|
@ -7,6 +7,7 @@ use App\Models\Keyword;
|
||||||
use Illuminate\Support\Facades\Validator;
|
use Illuminate\Support\Facades\Validator;
|
||||||
use Illuminate\Validation\Rule;
|
use Illuminate\Validation\Rule;
|
||||||
use Slowlyo\OwlAdmin\Models\AdminPermission;
|
use Slowlyo\OwlAdmin\Models\AdminPermission;
|
||||||
|
use Slowlyo\OwlAdmin\Services\AdminPermissionService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @method Keyword getModel()
|
* @method Keyword getModel()
|
||||||
|
|
@ -91,13 +92,15 @@ class KeywordService extends BaseService
|
||||||
|
|
||||||
public function afterCreate($model)
|
public function afterCreate($model)
|
||||||
{
|
{
|
||||||
// 创建对应的权限
|
if ($model->type_key == 'treat_type') {
|
||||||
AdminPermission::updateOrCreate([
|
// 创建对应的权限
|
||||||
'slug' => $model->key,
|
(new AdminPermissionService())->store([
|
||||||
], [
|
'slug' => $model->key,
|
||||||
'name' => $model->name,
|
'name' => $model->name,
|
||||||
'parent_id' => 0,
|
'parent_id' => 0,
|
||||||
'order' => 1
|
'order' => 1
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue