From c118b6d49406f813315226f07d4d0becb2f4ca19 Mon Sep 17 00:00:00 2001 From: root Date: Sun, 27 Oct 2019 20:46:03 +0800 Subject: [PATCH] update --- app/Http/Controllers/Admin/PlanController.php | 3 +- app/Http/Requests/Admin/PlanUpdate.php | 29 +++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 app/Http/Requests/Admin/PlanUpdate.php diff --git a/app/Http/Controllers/Admin/PlanController.php b/app/Http/Controllers/Admin/PlanController.php index a95e8785..ded6481a 100755 --- a/app/Http/Controllers/Admin/PlanController.php +++ b/app/Http/Controllers/Admin/PlanController.php @@ -3,6 +3,7 @@ namespace App\Http\Controllers\Admin; use App\Http\Requests\Admin\PlanSave; +use App\Http\Requests\Admin\PlanUpdate; use Illuminate\Http\Request; use App\Http\Controllers\Controller; use App\Models\Plan; @@ -63,7 +64,7 @@ class PlanController extends Controller ]); } - public function update (Request $request) { + public function update (PlanUpdate $request) { $updateData = $request->only([ 'show', 'renew' diff --git a/app/Http/Requests/Admin/PlanUpdate.php b/app/Http/Requests/Admin/PlanUpdate.php new file mode 100644 index 00000000..96354525 --- /dev/null +++ b/app/Http/Requests/Admin/PlanUpdate.php @@ -0,0 +1,29 @@ + 'in:0,1', + 'renew' => 'in:0,1' + ]; + } + + public function messages() + { + return [ + 'show.in' => '销售状态格式不正确', + 'renew.in' => '续费状态格式不正确' + ]; + } +}