Travel Guide Frontend Backend

This commit is contained in:
Kevin Adametz 2020-08-07 16:00:55 +02:00
parent e6cc042aee
commit 0857a34766
681 changed files with 6680 additions and 1689 deletions

View file

@ -0,0 +1,57 @@
<?php
namespace App\Http\Controllers\Settings;
use App\Http\Controllers\Controller;
use App\Models\IQContentCategory;
use App\Services\Util;
use Request;
class CategoryController extends Controller
{
public function __construct()
{
$this->middleware('admin');
}
public function index($step = false)
{
$data = [
'airline' => IQContentCategory::all(),
];
return view('settings.category.index', $data);
}
public function update(){
$data = Request::all();
$data['active'] = isset($data['active']) ? true : false;
if($data['id'] === "new"){
$model = IQContentCategory::create($data);
}else{
$model = IQContentCategory::find($data['id']);
$model->fill($data);
$model->save();
}
\Session()->flash('alert-save', '1');
return redirect(route('admin_settings_categories'));
}
public function delete($id){
//TODO check ist linked
$model = IQContentCategory::findOrFail($id);
$model->delete();
\Session()->flash('alert-success', 'Eintrag gelöscht');
return redirect()->back();
}
}