diff --git a/app/Http/Controllers/Admin/PaymentController.php b/app/Http/Controllers/Admin/PaymentController.php index bd03664f..159ab41b 100644 --- a/app/Http/Controllers/Admin/PaymentController.php +++ b/app/Http/Controllers/Admin/PaymentController.php @@ -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() + ]); + } } diff --git a/app/Http/Routes/AdminRoute.php b/app/Http/Routes/AdminRoute.php index f5032249..5b9640a2 100644 --- a/app/Http/Routes/AdminRoute.php +++ b/app/Http/Routes/AdminRoute.php @@ -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'); }); } }