VerifyAction.php 621 B

123456789101112131415161718192021222324252627
  1. <?php
  2. namespace App\Admin\Actions;
  3. use Encore\Admin\Actions\RowAction;
  4. use Illuminate\Database\Eloquent\Model;
  5. class VerifyAction extends RowAction
  6. {
  7. public $name = '审核';
  8. public function handle(Model $model)
  9. {
  10. $model->save();
  11. return $this->response()->success('处理完成.')->refresh();
  12. }
  13. public function form()
  14. {
  15. $this->select('type', '请选择...')->options([1=>'审核通过',2=>'拒绝']);
  16. $this->textarea('answers', '拒绝原因')->rules('required');
  17. }
  18. // public function dialog()
  19. // {
  20. // $this->confirm('确定吗?');
  21. // }
  22. }