Validation fix

This commit is contained in:
Julian Prieber 2024-02-04 16:49:39 +01:00
parent fab00365e2
commit 6aad9e2010
1 changed files with 7 additions and 1 deletions

View File

@ -199,6 +199,9 @@ class UserController extends Controller
//Save add link //Save add link
public function saveLink(request $request) public function saveLink(request $request)
{ {
$request->validate([
'link' => 'sometimes|url',
]);
$linkType = LinkType::find($request->linktype_id); $linkType = LinkType::find($request->linktype_id);
$LinkTitle = ($request->link_text ?? $request->link_title) ?? $request->title; $LinkTitle = ($request->link_text ?? $request->link_title) ?? $request->title;
@ -704,7 +707,7 @@ class UserController extends Controller
public function editLink(request $request) public function editLink(request $request)
{ {
$request->validate([ $request->validate([
'link' => 'required', 'link' => 'required|url',
'title' => 'required', 'title' => 'required',
'button' => 'required', 'button' => 'required',
]); ]);
@ -1200,6 +1203,9 @@ class UserController extends Controller
//Edit/save page icons //Edit/save page icons
public function editIcons(request $request) public function editIcons(request $request)
{ {
$request->validate([
'link' => 'required|url',
]);
function searchIcon($icon) function searchIcon($icon)
{ {