<?php

namespace App\Admin\Actions\Community\Nurse;

use App\Models\Order;
use Encore\Admin\Actions\RowAction;
use Illuminate\Database\Eloquent\Model;

class  DelNurse extends RowAction
{
    public $name = '删除';

    public function handle(Model $model)
    {
        $id = $this->row->id;
        $order_id = $this->row->order_id;
        $model->where('id',$id)->delete();
        Order::where('id',$order_id)->delete();
        return $this->response()->success('Success message.')->refresh();
    }

}
