23.11 Upload to live
This commit is contained in:
parent
8cae2f92a4
commit
8ebdacec98
80 changed files with 7320 additions and 3937 deletions
|
|
@ -23,7 +23,6 @@ class ProductController extends Controller
|
|||
|
||||
public function index()
|
||||
{
|
||||
|
||||
$data = [
|
||||
'values' => Product::all(),
|
||||
];
|
||||
|
|
@ -89,7 +88,7 @@ class ProductController extends Controller
|
|||
|
||||
// Upload FILE -----------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
public function uploadImage(){
|
||||
public function imageUpload(){
|
||||
|
||||
$product_id = Input::get('product_id');
|
||||
$product = Product::findOrFail($product_id);
|
||||
|
|
@ -143,7 +142,7 @@ class ProductController extends Controller
|
|||
}
|
||||
}
|
||||
|
||||
public function deleteImage($image_id, $product_id){
|
||||
public function imageDelete($image_id, $product_id){
|
||||
|
||||
$product = Product::findOrFail($product_id);
|
||||
$product_image = ProductImage::findOrFail($image_id);
|
||||
|
|
@ -163,4 +162,20 @@ class ProductController extends Controller
|
|||
|
||||
}
|
||||
|
||||
public function imageAttribute($product_id, $attr, $val = false){
|
||||
|
||||
if(is_numeric($val) && $val < 0){
|
||||
$val = 0;
|
||||
}
|
||||
|
||||
$product_image = ProductImage::findOrFail($product_id);
|
||||
|
||||
$product_image->{$attr} = $val;
|
||||
$product_image->save();
|
||||
|
||||
\Session()->flash('alert-success', "Wert gespeichert");
|
||||
return redirect()->back();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue