This commit is contained in:
Kevin Adametz 2020-01-02 19:22:30 +01:00
parent 1ad3f80bb0
commit 80dc93b6b8
39 changed files with 1057 additions and 80 deletions

View file

@ -24,7 +24,7 @@ class ProductController extends Controller
public function index()
{
$data = [
'values' => Product::all(),
'values' => Product::orderBy('pos', 'DESC')->orderBy('id', 'DESC')->get(),
];
return view('admin.product.index', $data);
}
@ -78,6 +78,17 @@ class ProductController extends Controller
}
public function copy($id){
$model = Product::findOrFail($id);
$product = $this->productRepo->copy($model);
\Session()->flash('alert-success', 'Eintrag kopiert');
return redirect(route('admin_product_show'));
}
public function delete($id){
$model = Product::findOrFail($id);
$model->delete();