add: payment drop

This commit is contained in:
tokumeikoi 2021-05-07 00:10:05 +09:00
parent 8e1a313709
commit ef1c0b6091
2 changed files with 10 additions and 0 deletions

View File

@ -64,4 +64,13 @@ class PaymentController extends Controller
'data' => true
]);
}
public function drop(Request $request)
{
$payment = Payment::find($request->input('id'));
if (!$payment) abort(500, '支付方式不存在');
return response([
'data' => $payment->delete()
]);
}
}

View File

@ -104,6 +104,7 @@ class AdminRoute
$router->get ('/payment/getPaymentMethods', 'Admin\\PaymentController@getPaymentMethods');
$router->post('/payment/getPaymentForm', 'Admin\\PaymentController@getPaymentForm');
$router->post('/payment/save', 'Admin\\PaymentController@save');
$router->post('/payment/drop', 'Admin\\PaymentController@drop');
});
}
}