move into sonardesk

This commit is contained in:
Mark Gregory
2026-10-12 14:50:13 +01:00
parent 5f0d2ceb72
commit 38b4a7406f
879 changed files with 24021 additions and 1 deletions
+27
View File
@@ -0,0 +1,27 @@
<?php
namespace Modules\Seo\Http\Controllers;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Modules\Settings\Models\Setting;
final class SeoController extends Controller
{
public function index()
{
$values = Setting::where('group', 'seo')->pluck('value', 'key');
return view('seo::index', compact('values'));
}
public function update(Request $request)
{
$data = $request->validate(['site_title' => ['nullable', 'string', 'max:255'], 'meta_description' => ['nullable', 'string', 'max:500'], 'robots' => ['required', 'string', 'max:100'], 'canonical_base' => ['nullable', 'url', 'max:255']]);
foreach ($data as $key => $value) {
Setting::updateOrCreate(['group' => 'seo', 'key' => $key], ['value' => $value, 'type' => 'string', 'is_public' => true]);
}
return back()->with('status', 'SEO defaults saved.');
}
}