<?php

namespace Modules\Mall\Http\Controllers\Admin\Action\Goods;

use Encore\Admin\Actions\RowAction;
use Illuminate\Database\Eloquent\Model;

class Down extends RowAction
{
    public $name = '下架';

    public function handle(Model $model)
    {
        if ($model->down()) {
            return $this->response()->success('下架成功')->refresh();
        } else {
            return $this->response()->error('下架失败')->refresh();
        }
    }

    public function dialog()
    {
        $this->confirm('确定下架吗');
    }

}