%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home/silvzytp/crm-dub-code/app/Http/Controllers/Backend/
Upload File :
Create Path :
Current File : //home/silvzytp/crm-dub-code/app/Http/Controllers/Backend/SettingController.php

<?php

namespace App\Http\Controllers\Backend;

use App\Http\Controllers\Controller;
use App\Models\Setting;
use Illuminate\Http\Request;

class SettingController extends Controller
{

    public function settingForm(){
        page_title('Settings');
        $breadcrumb = ['Dashboard'=>route(routeName().'.dashboard'),'Settings'=>''];
        return view('backend.settings.form', ['breadcrumb'=>$breadcrumb]);
    }

    public function updateOrStore(Request $request){
        $logo = file_update($request->file('logo'),'logo/',config('settings.logo'));
        $favicon = file_update($request->file('favicon'),'logo/',config('settings.favicon'));
        Setting::updateOrCreate(['key'=>'site_title'],['value'=>$request->title]);
        Setting::updateOrCreate(['key'=>'logo'],['value'=>$logo]);
        Setting::updateOrCreate(['key'=>'favicon'],['value'=>$favicon]);
        Setting::updateOrCreate(['key'=>'sidebar_f_size'],['value'=>$request->sidebar_f_size]);
        Setting::updateOrCreate(['key'=>'body_f_size'],['value'=>$request->body_f_size]);
        Setting::updateOrCreate(['key'=>'hotline'],['value'=>$request->hotline]);
        Setting::updateOrCreate(['key'=>'copyright'],['value'=>$request->copyright]);
        
        return back()->with('success','Setting Added.');
    }
}

Zerion Mini Shell 1.0