main system
This commit is contained in:
parent
0baac018a2
commit
a96d7d5c77
115 changed files with 4589 additions and 557 deletions
54
app/Http/Controllers/SettingController.php
Executable file
54
app/Http/Controllers/SettingController.php
Executable file
|
|
@ -0,0 +1,54 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\Category;
|
||||
use App\Models\Ingredient;
|
||||
use App\Models\IqImage;
|
||||
use App\Models\ProductCategory;
|
||||
use App\Models\ProductIngredient;
|
||||
use App\Models\Setting;
|
||||
use Request;
|
||||
|
||||
|
||||
class SettingController extends Controller
|
||||
{
|
||||
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('admin');
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
|
||||
$data = [
|
||||
'values' => Ingredient::all(),
|
||||
];
|
||||
return view('admin.settings.index', $data);
|
||||
}
|
||||
|
||||
|
||||
public function store()
|
||||
{
|
||||
|
||||
$data = Request::all();
|
||||
|
||||
if(isset($data['action'])){
|
||||
if(isset($data['settings'])){
|
||||
foreach ($data['settings'] as $key=>$value){
|
||||
Setting::setContentBySlug($key, $value['val'], $value['type']);
|
||||
}
|
||||
}
|
||||
}
|
||||
\Session()->flash('alert-save', '1');
|
||||
return redirect(route('admin_settings'));
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue