style updates
This commit is contained in:
@@ -1,7 +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.'); }
|
||||
|
||||
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.');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user