public function product_image_status($id) { // dd($id); $data = ProdcutImageModel::findOrfail($id); if ($data->status == 0) { ProdcutImageModel::where('id', $id)->update(['status' => 1]); return back()->with('message', 'status change successfully.....'); } elseif ($data->status == 1) { ProdcutImageModel::where('id', $id)->update(['status' => 0]); return back()->with('message', 'status change successfully.....'); } }
/** * send product image for product Image table * * @return collection */ public static function getProductImageById($id) { return ProdcutImageModel::where('product_id', $id)->get(); }