Merge pull request #10112 from snipe/fixes/strtolower_for_category_type

Improved category_type with strtolower() to make it case insensitive
This commit is contained in:
snipe 2021-09-21 15:54:35 -07:00 committed by GitHub
commit a22c35140b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -63,6 +63,7 @@ class CategoriesController extends Controller
$this->authorize('create', Category::class);
$category = new Category;
$category->fill($request->all());
$category->category_type = strtolower($request->input('category_type'));
$category = $request->handleImages($category);
if ($category->save()) {
@ -103,6 +104,7 @@ class CategoriesController extends Controller
$this->authorize('update', Category::class);
$category = Category::findOrFail($id);
$category->fill($request->all());
$category->category_type = strtolower($request->input('category_type'));
$category = $request->handleImages($category);
if ($category->save()) {