FleetCart/Themes/Storefront/Http/Controllers/Admin/StorefrontController.php

37 lines
920 B
PHP
Raw Normal View History

2023-06-11 12:14:03 +00:00
<?php
namespace Themes\Storefront\Http\Controllers\Admin;
2023-12-03 14:07:47 +00:00
use Illuminate\Http\Response;
2023-06-11 12:14:03 +00:00
use Modules\Admin\Ui\Facades\TabManager;
use Themes\Storefront\Http\Requests\SaveStorefrontRequest;
class StorefrontController
{
/**
* Show the form for editing the specified resource.
*
2023-12-03 14:07:47 +00:00
* @return Response
2023-06-11 12:14:03 +00:00
*/
public function edit()
{
$settings = setting()->all();
$tabs = TabManager::get('storefront');
return view('admin.storefront.edit', compact('settings', 'tabs'));
}
2023-12-03 14:07:47 +00:00
2023-06-11 12:14:03 +00:00
/**
* Update the specified resource in storage.
*
2023-12-03 14:07:47 +00:00
* @return Response
2023-06-11 12:14:03 +00:00
*/
public function update(SaveStorefrontRequest $request)
{
setting($request->except('_token', '_method'));
2023-12-03 14:07:47 +00:00
return back()->withSuccess(trans('admin::messages.resource_updated', ['resource' => trans('setting::settings.settings')]));
2023-06-11 12:14:03 +00:00
}
}