This commit is contained in:
2023-03-08 09:16:04 +08:00
commit e78454540f
1318 changed files with 210569 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
<?php
namespace Modules\User\Http\Controllers\Admin\Actions\Certification;
use Encore\Admin\Actions\RowAction;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\DB;
class Replicate extends RowAction
{
public $name = '复制配置';
public function handle(Model $model)
{
try {
DB::transaction(function () use ($model) {
$new = $model->replicate();
$new->status = 0;
$new->save();
});
return $this->response()->success('复制菜单完成')->refresh();
} catch (\Exception $exception) {
return $this->response()->error('复制菜单出错了')->refresh();
}
}
public function dialog()
{
$this->confirm('确定复制配置么?');
}
}