validate([ 'label' => 'required|string|max:255', ]); $label = $request->label; if ($id !== null) $theme = ForumThemes::findOrFail($id); else $theme = new ForumThemes(); $theme->label = $label; $theme->save(); return redirect()->route('bo.forum-themes'); } }