From 48f435adc1d730a97c857806d769427de94c0ee2 Mon Sep 17 00:00:00 2001 From: Ikhsan Satriadi Date: Tue, 9 Jul 2024 10:46:47 +0700 Subject: [PATCH] Update LoansController.php Use Method class instead hardcoded string --- app/Controllers/Loans/LoansController.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Controllers/Loans/LoansController.php b/app/Controllers/Loans/LoansController.php index 6f6fae0..7b372e2 100644 --- a/app/Controllers/Loans/LoansController.php +++ b/app/Controllers/Loans/LoansController.php @@ -7,6 +7,7 @@ use App\Models\LoanModel; use App\Models\MemberModel; use CodeIgniter\Exceptions\PageNotFoundException; +use CodeIgniter\HTTP\Method; use CodeIgniter\I18n\Time; use CodeIgniter\RESTful\ResourceController; @@ -237,7 +238,7 @@ function ($carry, $item) { */ public function new($validation = null, $oldInput = null) { - if ($this->request->getMethod() !== 'POST') { + if ($this->request->getMethod() !== Method::POST) { return redirect()->to('admin/loans/new/members/search'); }