From aab53cf6832c98ef7940df2d043a265505888a1b Mon Sep 17 00:00:00 2001 From: akemidx Date: Wed, 26 Apr 2023 15:18:13 -0400 Subject: [PATCH] remove regex, add in starts_with --- app/Http/Requests/SaveManufacturerRequest.php | 41 ------------------- app/Models/Manufacturer.php | 2 +- 2 files changed, 1 insertion(+), 42 deletions(-) delete mode 100644 app/Http/Requests/SaveManufacturerRequest.php diff --git a/app/Http/Requests/SaveManufacturerRequest.php b/app/Http/Requests/SaveManufacturerRequest.php deleted file mode 100644 index dc96042e09..0000000000 --- a/app/Http/Requests/SaveManufacturerRequest.php +++ /dev/null @@ -1,41 +0,0 @@ -getRules(); - } - - /** - * Prepare the data for validation. - * - * @return void - */ - protected function prepareForValidation() - { - $this->merge([ - 'support_url' => $this->input('support_url'), - ]); - dd($this->all()); - } -} diff --git a/app/Models/Manufacturer.php b/app/Models/Manufacturer.php index 4d61e10429..6acbffe7cd 100755 --- a/app/Models/Manufacturer.php +++ b/app/Models/Manufacturer.php @@ -24,7 +24,7 @@ class Manufacturer extends SnipeModel 'name' => 'required|min:2|max:255|unique:manufacturers,name,NULL,id,deleted_at,NULL', 'url' => 'url|nullable', 'support_email' => 'email|nullable', - 'support_url' => ['regex:/.+:\/\/.+/','nullable'], + 'support_url' => ['starts_with:http://,https://,afp://,facetime://,file://,irc://','nullable'], ]; protected $hidden = ['user_id'];