Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

<?php namespace App\Http\Controllers\Frontend; use App\Http\Controllers\Controller; use ..

Decoded Output download

<?php 
 namespace App\Http\Controllers\Frontend; use App\Http\Controllers\Controller; use App\Models\Category; use App\Models\Product; use App\Models\Review; use App\Models\SubCategory; use Illuminate\Http\Request; class ProductController extends Controller { public function index() { $data["products"] = Product::where("status", "published")->paginate(18); return view("frontend.products.products", $data); } public function details($slug) { $data["product"] = Product::where("slug", $slug)->first(); if ($data["product"]) { $data["product_reviews"] = Review::where("product_id", $data["product"]->id)->orderBy("id", "desc")->get(); return view("frontend.products.product_details", $data); } else { return redirect()->route("frontend.products")->with("error", "Product Not Found!"); } } public function details_ajax($uuid) { $product = Product::where("uuid", $uuid)->first(); if ($product) { $reviews = Review::where("product_id", $product->id)->orderBy("id", "desc")->get(); $avgRating = $reviews->avg("rating"); $data = array("uuid" => $product->uuid, "slug" => $product->slug, "name" => $product->name, "photo" => $product->photo, "category" => $product->category->name, "item_sold" => $product->item_sold, "description" => $product->description, "currency_symbol" => env("APP_CURRENCY_SYMBOL"), "base_price" => $product->base_price, "reviews" => $reviews, "avg_rating" => $avgRating); return response(array("data" => $data, "message" => "Product Found", "status" => "success"), 200); } else { return response(array("data" => '', "message" => "Product Not Found", "status" => "failed"), 200); } } public function search_product_cat($cat_slug = null, $sub_cat_slug = null) { try { $data["products"] = array(); if (!empty($sub_cat_slug)) { $sub_category = SubCategory::where("slug", $sub_cat_slug)->first(); if ($sub_category) { $data["products"] = Product::where(array("status" => "published", "sub_category_id" => $sub_category->id))->paginate(18); } } elseif (!empty($cat_slug)) { $category = Category::where("slug", $cat_slug)->first(); if ($category) { $data["products"] = Product::where(array("status" => "published", "category_id" => $category->id))->paginate(18); } } return view("frontend.products.products", $data); } catch (\Exception $e) { return redirect()->back()->with("error", "Something Went Wrong!"); } } public function search_product(Request $request) { try { $data["products"] = array(); if (!empty($request->p)) { $searchQuery = "%" . $request->p . "%"; $data["products"] = Product::where("name", "LIKE", $searchQuery)->paginate(18); } return view("frontend.products.products", $data); } catch (\Exception $e) { return redirect()->back()->with("error", "Something Went Wrong!"); } } public function filter_price(Request $request) { try { $min_value = $request->min_value; $max_value = $request->max_value; $products = Product::where("status", "published")->whereBetween("base_price", array($min_value, $max_value))->get(); if (count($products) > 0) { return response(array("data" => $products, "message" => count($products) . " Products Found!", "status" => "success")); } else { return response(array("data" => null, "message" => "0 Products Found!", "status" => "not_found")); } } catch (\Exception $e) { return response(array("data" => '', "message" => $e->getMessage(), "status" => "error")); } } public function store(Request $request) { try { $data = array("product_id" => decrypt($request->input("product_id")), "user_id" => $request->input("user_id"), "rating" => $request->input("rating"), "comment" => $request->input("comment"), "cus_name" => $request->input("cus_name"), "cus_email" => $request->input("cus_email"), "cus_phone" => $request->input("cus_phone"), "ip_address" => $request->ip()); Review::create($data); return redirect()->back()->with("success", "Review Submitted Successfully!"); } catch (\Exception $e) { return redirect()->back()->with("error", "Something Went Wrong! Try Again Later..."); } } } ?>

Did this file decode correctly?

Original Code

<?php
 namespace App\Http\Controllers\Frontend; use App\Http\Controllers\Controller; use App\Models\Category; use App\Models\Product; use App\Models\Review; use App\Models\SubCategory; use Illuminate\Http\Request; class ProductController extends Controller { public function index() { $data["\x70\162\x6f\144\165\143\164\163"] = Product::where("\x73\164\141\x74\x75\x73", "\x70\x75\x62\154\151\x73\x68\145\x64")->paginate(18); return view("\146\162\x6f\156\x74\x65\x6e\x64\x2e\160\162\157\x64\165\x63\x74\x73\x2e\x70\162\157\x64\x75\143\x74\163", $data); } public function details($slug) { $data["\160\x72\157\x64\165\143\x74"] = Product::where("\x73\x6c\165\147", $slug)->first(); if ($data["\160\162\157\x64\x75\143\164"]) { $data["\x70\162\157\144\165\x63\x74\137\162\x65\166\x69\145\x77\x73"] = Review::where("\160\x72\157\x64\x75\143\164\137\x69\x64", $data["\x70\x72\x6f\144\165\x63\x74"]->id)->orderBy("\151\144", "\144\145\163\143")->get(); return view("\146\x72\157\x6e\x74\x65\156\144\x2e\160\162\157\144\x75\x63\164\163\56\160\x72\x6f\144\165\x63\164\x5f\x64\x65\164\141\151\154\x73", $data); } else { return redirect()->route("\146\x72\157\x6e\164\145\x6e\144\x2e\160\162\x6f\144\165\x63\x74\163")->with("\145\162\162\157\x72", "\120\162\157\x64\165\x63\164\40\x4e\x6f\x74\x20\106\157\x75\156\144\x21"); } } public function details_ajax($uuid) { $product = Product::where("\x75\x75\x69\x64", $uuid)->first(); if ($product) { $reviews = Review::where("\160\x72\157\144\x75\143\x74\137\x69\x64", $product->id)->orderBy("\x69\144", "\x64\x65\x73\143")->get(); $avgRating = $reviews->avg("\162\x61\x74\x69\156\147"); $data = array("\x75\165\x69\x64" => $product->uuid, "\163\154\165\x67" => $product->slug, "\x6e\141\x6d\145" => $product->name, "\160\150\x6f\164\157" => $product->photo, "\143\141\x74\145\x67\x6f\162\171" => $product->category->name, "\151\x74\145\x6d\137\x73\x6f\154\144" => $product->item_sold, "\x64\145\163\x63\x72\x69\x70\164\x69\x6f\x6e" => $product->description, "\143\x75\162\162\x65\156\143\x79\x5f\163\171\x6d\142\157\154" => env("\x41\x50\120\137\x43\x55\122\122\x45\x4e\x43\x59\x5f\123\131\x4d\x42\117\114"), "\x62\x61\163\x65\137\x70\162\151\143\x65" => $product->base_price, "\x72\145\166\151\x65\x77\x73" => $reviews, "\141\166\147\x5f\x72\x61\x74\x69\156\x67" => $avgRating); return response(array("\x64\141\x74\x61" => $data, "\x6d\x65\x73\x73\x61\147\x65" => "\x50\x72\x6f\x64\165\143\164\x20\106\157\165\156\x64", "\x73\164\141\x74\165\x73" => "\x73\165\143\x63\x65\163\163"), 200); } else { return response(array("\144\x61\164\x61" => '', "\x6d\145\x73\x73\141\x67\145" => "\120\x72\157\144\x75\143\164\x20\116\157\x74\40\106\157\165\x6e\144", "\163\x74\x61\164\165\x73" => "\146\x61\x69\154\x65\144"), 200); } } public function search_product_cat($cat_slug = null, $sub_cat_slug = null) { try { $data["\x70\x72\x6f\144\x75\x63\x74\163"] = array(); if (!empty($sub_cat_slug)) { $sub_category = SubCategory::where("\163\154\165\x67", $sub_cat_slug)->first(); if ($sub_category) { $data["\160\x72\157\144\x75\x63\164\x73"] = Product::where(array("\x73\x74\141\x74\x75\x73" => "\x70\165\142\x6c\151\x73\150\145\x64", "\x73\x75\142\x5f\x63\x61\x74\x65\147\157\x72\171\x5f\151\x64" => $sub_category->id))->paginate(18); } } elseif (!empty($cat_slug)) { $category = Category::where("\x73\154\165\147", $cat_slug)->first(); if ($category) { $data["\x70\162\x6f\144\165\143\164\163"] = Product::where(array("\x73\x74\x61\x74\x75\x73" => "\160\x75\142\x6c\x69\163\150\x65\144", "\143\x61\x74\145\147\157\x72\171\x5f\x69\144" => $category->id))->paginate(18); } } return view("\146\x72\157\x6e\164\145\x6e\144\x2e\x70\162\157\144\x75\143\164\163\x2e\x70\x72\x6f\x64\165\143\x74\163", $data); } catch (\Exception $e) { return redirect()->back()->with("\x65\162\x72\x6f\162", "\123\x6f\x6d\145\164\150\151\156\147\x20\x57\x65\x6e\x74\x20\x57\162\x6f\x6e\147\x21"); } } public function search_product(Request $request) { try { $data["\x70\162\157\x64\165\x63\x74\163"] = array(); if (!empty($request->p)) { $searchQuery = "\x25" . $request->p . "\45"; $data["\x70\x72\x6f\x64\165\143\164\163"] = Product::where("\156\x61\155\145", "\114\x49\113\x45", $searchQuery)->paginate(18); } return view("\146\x72\x6f\x6e\164\x65\156\144\x2e\x70\x72\157\144\165\143\164\163\56\x70\162\x6f\144\x75\143\164\x73", $data); } catch (\Exception $e) { return redirect()->back()->with("\x65\162\x72\x6f\162", "\x53\x6f\x6d\145\x74\150\151\x6e\x67\x20\127\x65\x6e\164\40\127\x72\x6f\x6e\147\41"); } } public function filter_price(Request $request) { try { $min_value = $request->min_value; $max_value = $request->max_value; $products = Product::where("\163\x74\141\164\165\x73", "\x70\x75\x62\x6c\x69\x73\150\145\x64")->whereBetween("\142\141\163\145\x5f\x70\162\x69\x63\145", array($min_value, $max_value))->get(); if (count($products) > 0) { return response(array("\144\141\164\x61" => $products, "\155\145\x73\x73\141\x67\145" => count($products) . "\x20\120\x72\x6f\x64\165\143\164\163\40\106\157\165\x6e\144\x21", "\x73\x74\141\x74\x75\163" => "\163\x75\143\x63\145\163\x73")); } else { return response(array("\x64\141\164\141" => null, "\x6d\145\163\163\x61\x67\x65" => "\60\x20\120\162\x6f\144\x75\x63\164\163\x20\x46\157\165\156\144\x21", "\x73\x74\141\164\165\x73" => "\156\157\x74\137\x66\x6f\165\156\x64")); } } catch (\Exception $e) { return response(array("\144\141\x74\141" => '', "\155\x65\x73\163\x61\x67\145" => $e->getMessage(), "\x73\164\141\164\165\x73" => "\145\x72\162\x6f\162")); } } public function store(Request $request) { try { $data = array("\x70\x72\157\x64\x75\x63\x74\137\x69\x64" => decrypt($request->input("\160\x72\157\144\x75\143\x74\x5f\151\144")), "\165\x73\x65\x72\137\151\144" => $request->input("\165\163\145\162\x5f\x69\144"), "\162\x61\164\151\156\147" => $request->input("\x72\141\x74\151\x6e\147"), "\x63\x6f\155\x6d\145\156\164" => $request->input("\143\157\155\x6d\145\x6e\x74"), "\143\165\x73\137\x6e\x61\x6d\145" => $request->input("\x63\165\x73\137\156\141\x6d\145"), "\143\x75\x73\137\x65\x6d\x61\x69\x6c" => $request->input("\143\x75\163\x5f\145\155\141\151\x6c"), "\x63\165\163\x5f\x70\x68\x6f\156\x65" => $request->input("\x63\165\x73\x5f\160\150\157\x6e\x65"), "\x69\160\137\141\x64\144\162\145\x73\163" => $request->ip()); Review::create($data); return redirect()->back()->with("\x73\165\143\x63\145\x73\163", "\122\x65\x76\151\145\x77\x20\x53\x75\x62\155\151\164\164\x65\x64\40\x53\165\x63\x63\145\x73\163\146\x75\x6c\x6c\171\x21"); } catch (\Exception $e) { return redirect()->back()->with("\x65\162\162\x6f\x72", "\x53\157\155\145\x74\150\x69\156\x67\40\x57\145\x6e\164\x20\127\162\x6f\x6e\x67\41\x20\124\x72\171\x20\x41\x67\x61\x69\156\40\x4c\x61\164\x65\x72\x2e\56\56"); } } }

Function Calls

None

Variables

None

Stats

MD5 8e562b72f1e191b15c4804b45292440a
Eval Count 0
Decode Time 53 ms