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

Function Calls

None

Variables

None

Stats

MD5 a04622568c5c270df30dcee53eed37e0
Eval Count 0
Decode Time 68 ms