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\Backend; use App\Http\Controllers\Controller; use A..

Decoded Output download

<?php 
 namespace App\Http\Controllers\Backend; use App\Http\Controllers\Controller; use App\Models\Activity; use App\Models\Blog; use App\Models\ContentCategory; use App\Models\Document; use App\Models\DynamicSection; use App\Models\FrontSetting; use App\Models\ImageGallery; use App\Models\Module; use App\Models\Project; use App\Models\Page; use App\Models\Brand; use App\Models\ReceivedForm; use App\Models\SEOPost; use App\Models\Service; use App\Models\Slider; use App\Models\Style; use App\Models\Team; use App\Models\Setting; use App\Models\Testimonial; use App\Models\User; use Carbon\Carbon; use Database\Seeders\DatabaseSeeder; use Illuminate\Http\Request; use Illuminate\Support\Facades\Artisan; use Illuminate\Support\Facades\File; use Illuminate\Support\Facades\Session; use Illuminate\Support\Facades\Validator; use Illuminate\Support\Str; use Image; class MainController extends Controller { public function home() { $logCount = Activity::count(); $active_lang = Session::get("language"); if ($logCount >= 500 && $logCount % 500 === 0) { Activity::deleteOldestLogs(500); } $active_modules = Module::where(array("status" => "active", "lang" => $active_lang))->get(); $data = ReceivedForm::all(); return view("dashboard", array("active_modules" => $active_modules, "data" => $data)); } public function error() { return abort(404); } public function setup() { $getSetting = Setting::first(); if (empty($getSetting)) { Artisan::call("migrate:fresh"); Artisan::call("db:seed", array("--class" => DatabaseSeeder::class)); } else { return abort(404); } } public function PhotoDelete(Request $request) { $data_id = $request->input("data_id"); $filename = $request->input("filename"); $data_from = $request->input("data_from"); if ($data_from == "Users") { $fullImgPath = base_path("public/uploads/avatars/{$filename}"); if (File::exists($fullImgPath)) { File::delete($fullImgPath); User::find($data_id)->update(array("image" => NULL)); } } elseif ($data_from == "Settings") { $fullImgPath = base_path("public/uploads/settings/{$filename}"); if (File::exists($fullImgPath)) { File::delete($fullImgPath); } } elseif ($data_from == "Frontend") { $fullImgPath = base_path("public/uploads/frontend/{$filename}"); if (File::exists($fullImgPath)) { File::delete($fullImgPath); } } elseif ($data_from == "Blog") { $fullImgPath = base_path("public/uploads/blogs/{$filename}"); if (File::exists($fullImgPath)) { Blog::find($data_id)->update(array("image" => NULL)); File::delete($fullImgPath); } } elseif ($data_from == "Service") { $fullImgPath = base_path("public/uploads/services/{$filename}"); if (File::exists($fullImgPath)) { Service::find($data_id)->update(array("image" => NULL)); File::delete($fullImgPath); } } elseif ($data_from == "Page") { $fullImgPath = base_path("public/uploads/pages/{$filename}"); if (File::exists($fullImgPath)) { Page::find($data_id)->update(array("image" => NULL)); File::delete($fullImgPath); } } elseif ($data_from == "Brand") { $fullImgPath = base_path("public/uploads/brands/{$filename}"); if (File::exists($fullImgPath)) { Brand::find($data_id)->update(array("image" => NULL)); File::delete($fullImgPath); } } elseif ($data_from == "Project") { $fullImgPath = base_path("public/uploads/projects/{$filename}"); if (File::exists($fullImgPath)) { Project::find($data_id)->update(array("image" => NULL)); File::delete($fullImgPath); } } elseif ($data_from == "Team") { $fullImgPath = base_path("public/uploads/teams/{$filename}"); if (File::exists($fullImgPath)) { Team::find($data_id)->update(array("image" => NULL)); File::delete($fullImgPath); } } elseif ($data_from == "Testimonial") { $fullImgPath = base_path("public/uploads/testimonials/{$filename}"); if (File::exists($fullImgPath)) { Testimonial::find($data_id)->update(array("image" => NULL)); File::delete($fullImgPath); } } elseif ($data_from == "ImageGallery") { $fullImgPath = base_path("public/uploads/image-gallery/{$filename}"); if (File::exists($fullImgPath)) { ImageGallery::find($data_id)->update(array("image" => NULL)); File::delete($fullImgPath); } } elseif ($data_from == "Logo") { $fullImgPath = base_path("public/uploads/logos/{$filename}"); if (File::exists($fullImgPath)) { Style::find($data_id)->update(array("logo" => NULL)); File::delete($fullImgPath); } } elseif ($data_from == "WhiteLogo") { $fullImgPath = base_path("public/uploads/logos/{$filename}"); if (File::exists($fullImgPath)) { Style::find($data_id)->update(array("white_logo" => NULL)); File::delete($fullImgPath); } } elseif ($data_from == "FooterLogo") { $fullImgPath = base_path("public/uploads/logos/{$filename}"); if (File::exists($fullImgPath)) { Style::find($data_id)->update(array("footer_logo" => NULL)); File::delete($fullImgPath); } } elseif ($data_from == "Favicon") { $fullImgPath = base_path("public/uploads/logos/{$filename}"); if (File::exists($fullImgPath)) { Style::find($data_id)->update(array("favicon" => NULL)); File::delete($fullImgPath); } } elseif ($data_from == "Widget") { $fullImgPath = base_path("public/uploads/widgets/{$filename}"); if (File::exists($fullImgPath)) { Style::find($data_id)->update(array("sidebar_banner" => NULL)); File::delete($fullImgPath); } } elseif ($data_from == "Breadcrumb") { $style = Style::find($data_id); if ($style->breadcrumb) { $breadcrumbs = json_decode($style->breadcrumb, true); foreach ($breadcrumbs as $moduleSlug => $breadcrumbData) { if ($breadcrumbData["image_path"] == $filename) { $fullImgPath = public_path("uploads/breadcrumb/{$filename}"); if (File::exists($fullImgPath)) { File::delete($fullImgPath); } unset($breadcrumbs[$moduleSlug]); $style->breadcrumb = json_encode($breadcrumbs); $style->save(); break; } } } } elseif ($data_from == "Slider") { $fullImgPath = base_path("public/uploads/sliders/{$filename}"); if (File::exists($fullImgPath)) { Slider::find($data_id)->update(array("image" => NULL)); File::delete($fullImgPath); } } elseif ($data_from == "Document") { $fullImgPath = base_path("public/uploads/documents/{$filename}"); if (File::exists($fullImgPath)) { Document::find($data_id)->update(array("file" => NULL)); File::delete($fullImgPath); } } elseif ($data_from == "DynamicSection") { $fullImgPath = base_path("public/uploads/dynamic-sections/{$filename}"); if (File::exists($fullImgPath)) { DynamicSection::find($data_id)->update(array("image" => NULL)); File::delete($fullImgPath); } } elseif ($data_from == "Categories") { $fullImgPath = base_path("public/uploads/categories/{$filename}"); if (File::exists($fullImgPath)) { ContentCategory::find($data_id)->update(array("image" => NULL)); File::delete($fullImgPath); } } elseif ($data_from == "ProjectsGallery") { $project = Project::find($data_id); $toarray = json_decode($project->gallery, true); $fullImgPath = base_path("public/uploads/projects/{$filename}"); if (File::exists($fullImgPath)) { File::delete($fullImgPath); $search = array($filename); $result = array_diff($toarray, $search); $newgallery = json_encode($result); Project::find($data_id)->update(array("gallery" => $newgallery)); Session::flash("success", "Resim ba\xc5\237ar\304\xb1yla silindi."); } } elseif ($data_from == "ServicesGallery") { $project = Service::find($data_id); $toarray = json_decode($project->gallery, true); $fullImgPath = base_path("public/uploads/services/{$filename}"); if (File::exists($fullImgPath)) { File::delete($fullImgPath); $search = array($filename); $result = array_diff($toarray, $search); $newgallery = json_encode($result); Service::find($data_id)->update(array("gallery" => $newgallery)); Session::flash("success", "Resim ba\xc5\x9far\304\xb1yla silindi."); } } elseif ($data_from == "DynamicSectionGallery") { $project = DynamicSection::find($data_id); $toarray = json_decode($project->gallery, true); $fullImgPath = base_path("public/uploads/dynamic-sections/{$filename}"); if (File::exists($fullImgPath)) { File::delete($fullImgPath); $search = array($filename); $result = array_diff($toarray, $search); $newgallery = json_encode($result); DynamicSection::find($data_id)->update(array("gallery" => $newgallery)); Session::flash("success", "Resim ba\305\237ar\304\xb1yla silindi."); } } } } ?>

Did this file decode correctly?

Original Code

<?php
 namespace App\Http\Controllers\Backend; use App\Http\Controllers\Controller; use App\Models\Activity; use App\Models\Blog; use App\Models\ContentCategory; use App\Models\Document; use App\Models\DynamicSection; use App\Models\FrontSetting; use App\Models\ImageGallery; use App\Models\Module; use App\Models\Project; use App\Models\Page; use App\Models\Brand; use App\Models\ReceivedForm; use App\Models\SEOPost; use App\Models\Service; use App\Models\Slider; use App\Models\Style; use App\Models\Team; use App\Models\Setting; use App\Models\Testimonial; use App\Models\User; use Carbon\Carbon; use Database\Seeders\DatabaseSeeder; use Illuminate\Http\Request; use Illuminate\Support\Facades\Artisan; use Illuminate\Support\Facades\File; use Illuminate\Support\Facades\Session; use Illuminate\Support\Facades\Validator; use Illuminate\Support\Str; use Image; class MainController extends Controller { public function home() { $logCount = Activity::count(); $active_lang = Session::get("\154\141\156\147\165\x61\x67\145"); if ($logCount >= 500 && $logCount % 500 === 0) { Activity::deleteOldestLogs(500); } $active_modules = Module::where(array("\x73\x74\x61\164\x75\x73" => "\141\143\x74\151\x76\145", "\154\x61\156\147" => $active_lang))->get(); $data = ReceivedForm::all(); return view("\x64\x61\163\x68\x62\x6f\141\x72\x64", array("\x61\143\164\x69\166\x65\137\x6d\x6f\x64\165\154\x65\163" => $active_modules, "\x64\x61\x74\141" => $data)); } public function error() { return abort(404); } public function setup() { $getSetting = Setting::first(); if (empty($getSetting)) { Artisan::call("\x6d\151\147\x72\x61\164\x65\72\146\162\145\x73\150"); Artisan::call("\x64\x62\x3a\x73\145\x65\144", array("\55\55\143\154\x61\x73\x73" => DatabaseSeeder::class)); } else { return abort(404); } } public function PhotoDelete(Request $request) { $data_id = $request->input("\144\141\x74\141\137\151\144"); $filename = $request->input("\x66\151\x6c\x65\156\x61\x6d\145"); $data_from = $request->input("\144\x61\x74\141\137\x66\x72\x6f\x6d"); if ($data_from == "\125\x73\145\x72\163") { $fullImgPath = base_path("\160\165\142\x6c\x69\143\57\x75\160\154\157\141\x64\163\x2f\x61\x76\141\x74\x61\x72\x73\57{$filename}"); if (File::exists($fullImgPath)) { File::delete($fullImgPath); User::find($data_id)->update(array("\x69\155\141\147\x65" => NULL)); } } elseif ($data_from == "\x53\x65\x74\164\x69\156\x67\x73") { $fullImgPath = base_path("\x70\x75\x62\154\x69\143\57\165\x70\x6c\x6f\141\144\x73\x2f\163\145\x74\x74\151\156\147\163\x2f{$filename}"); if (File::exists($fullImgPath)) { File::delete($fullImgPath); } } elseif ($data_from == "\x46\x72\x6f\156\x74\x65\x6e\x64") { $fullImgPath = base_path("\x70\x75\142\154\x69\143\57\x75\160\x6c\157\x61\x64\163\57\146\x72\157\x6e\x74\145\156\x64\x2f{$filename}"); if (File::exists($fullImgPath)) { File::delete($fullImgPath); } } elseif ($data_from == "\x42\x6c\157\x67") { $fullImgPath = base_path("\x70\165\142\x6c\151\x63\57\165\x70\154\x6f\141\x64\x73\57\142\x6c\157\147\163\57{$filename}"); if (File::exists($fullImgPath)) { Blog::find($data_id)->update(array("\x69\155\x61\147\x65" => NULL)); File::delete($fullImgPath); } } elseif ($data_from == "\x53\145\162\x76\151\x63\145") { $fullImgPath = base_path("\x70\165\142\154\x69\x63\x2f\x75\160\x6c\157\141\144\x73\57\163\x65\x72\x76\151\143\145\163\x2f{$filename}"); if (File::exists($fullImgPath)) { Service::find($data_id)->update(array("\151\155\141\x67\145" => NULL)); File::delete($fullImgPath); } } elseif ($data_from == "\x50\x61\x67\x65") { $fullImgPath = base_path("\160\x75\x62\x6c\x69\143\57\x75\160\x6c\x6f\141\x64\x73\x2f\160\141\147\145\x73\57{$filename}"); if (File::exists($fullImgPath)) { Page::find($data_id)->update(array("\151\x6d\141\x67\x65" => NULL)); File::delete($fullImgPath); } } elseif ($data_from == "\x42\x72\x61\x6e\x64") { $fullImgPath = base_path("\160\x75\142\154\x69\143\57\165\x70\x6c\x6f\x61\x64\x73\x2f\x62\162\141\156\144\x73\x2f{$filename}"); if (File::exists($fullImgPath)) { Brand::find($data_id)->update(array("\151\155\141\x67\145" => NULL)); File::delete($fullImgPath); } } elseif ($data_from == "\x50\x72\x6f\152\x65\143\x74") { $fullImgPath = base_path("\160\x75\142\154\x69\x63\57\x75\160\154\157\141\x64\x73\57\x70\162\x6f\x6a\x65\x63\164\x73\57{$filename}"); if (File::exists($fullImgPath)) { Project::find($data_id)->update(array("\151\x6d\141\147\x65" => NULL)); File::delete($fullImgPath); } } elseif ($data_from == "\124\x65\x61\155") { $fullImgPath = base_path("\160\x75\142\x6c\x69\x63\57\165\160\154\157\141\144\163\57\164\145\141\x6d\163\x2f{$filename}"); if (File::exists($fullImgPath)) { Team::find($data_id)->update(array("\x69\155\x61\147\145" => NULL)); File::delete($fullImgPath); } } elseif ($data_from == "\124\145\x73\x74\x69\x6d\157\156\x69\141\154") { $fullImgPath = base_path("\x70\x75\142\154\x69\143\57\165\160\154\157\x61\144\x73\57\x74\x65\x73\x74\151\x6d\157\x6e\x69\x61\x6c\163\x2f{$filename}"); if (File::exists($fullImgPath)) { Testimonial::find($data_id)->update(array("\x69\155\x61\147\145" => NULL)); File::delete($fullImgPath); } } elseif ($data_from == "\111\x6d\141\147\x65\x47\141\x6c\154\x65\162\171") { $fullImgPath = base_path("\x70\165\x62\x6c\151\x63\x2f\165\x70\x6c\x6f\x61\144\163\57\x69\x6d\x61\x67\x65\55\147\141\x6c\x6c\145\x72\x79\x2f{$filename}"); if (File::exists($fullImgPath)) { ImageGallery::find($data_id)->update(array("\x69\155\x61\147\145" => NULL)); File::delete($fullImgPath); } } elseif ($data_from == "\x4c\157\x67\157") { $fullImgPath = base_path("\160\165\142\x6c\x69\143\x2f\165\x70\x6c\157\x61\x64\x73\57\154\x6f\x67\x6f\x73\x2f{$filename}"); if (File::exists($fullImgPath)) { Style::find($data_id)->update(array("\x6c\157\x67\157" => NULL)); File::delete($fullImgPath); } } elseif ($data_from == "\x57\x68\x69\x74\x65\114\x6f\x67\x6f") { $fullImgPath = base_path("\x70\x75\x62\x6c\x69\143\x2f\x75\160\x6c\x6f\x61\144\163\57\x6c\157\x67\157\163\x2f{$filename}"); if (File::exists($fullImgPath)) { Style::find($data_id)->update(array("\x77\x68\x69\x74\x65\137\x6c\x6f\x67\x6f" => NULL)); File::delete($fullImgPath); } } elseif ($data_from == "\106\157\x6f\x74\x65\162\114\x6f\x67\x6f") { $fullImgPath = base_path("\x70\165\x62\x6c\151\143\x2f\x75\160\154\x6f\x61\144\x73\x2f\154\157\x67\x6f\163\57{$filename}"); if (File::exists($fullImgPath)) { Style::find($data_id)->update(array("\146\157\x6f\164\145\x72\x5f\x6c\157\147\x6f" => NULL)); File::delete($fullImgPath); } } elseif ($data_from == "\x46\141\166\x69\x63\157\156") { $fullImgPath = base_path("\x70\x75\x62\154\x69\x63\x2f\165\160\154\x6f\x61\144\x73\57\154\157\x67\x6f\163\57{$filename}"); if (File::exists($fullImgPath)) { Style::find($data_id)->update(array("\x66\x61\166\x69\x63\157\x6e" => NULL)); File::delete($fullImgPath); } } elseif ($data_from == "\x57\151\x64\147\x65\x74") { $fullImgPath = base_path("\160\x75\x62\x6c\151\x63\x2f\165\160\x6c\x6f\x61\144\163\x2f\x77\x69\x64\147\145\164\x73\x2f{$filename}"); if (File::exists($fullImgPath)) { Style::find($data_id)->update(array("\x73\x69\144\145\142\141\162\x5f\142\141\156\156\145\162" => NULL)); File::delete($fullImgPath); } } elseif ($data_from == "\x42\x72\145\x61\x64\143\162\165\x6d\142") { $style = Style::find($data_id); if ($style->breadcrumb) { $breadcrumbs = json_decode($style->breadcrumb, true); foreach ($breadcrumbs as $moduleSlug => $breadcrumbData) { if ($breadcrumbData["\151\x6d\141\x67\x65\137\x70\x61\164\x68"] == $filename) { $fullImgPath = public_path("\165\160\x6c\x6f\141\x64\163\x2f\x62\162\145\x61\144\x63\x72\165\x6d\142\57{$filename}"); if (File::exists($fullImgPath)) { File::delete($fullImgPath); } unset($breadcrumbs[$moduleSlug]); $style->breadcrumb = json_encode($breadcrumbs); $style->save(); break; } } } } elseif ($data_from == "\123\x6c\151\x64\145\162") { $fullImgPath = base_path("\160\x75\x62\154\151\143\x2f\x75\160\154\x6f\x61\144\163\57\163\x6c\x69\144\x65\162\163\x2f{$filename}"); if (File::exists($fullImgPath)) { Slider::find($data_id)->update(array("\x69\x6d\141\147\x65" => NULL)); File::delete($fullImgPath); } } elseif ($data_from == "\x44\157\143\165\x6d\145\x6e\164") { $fullImgPath = base_path("\160\x75\142\154\151\x63\57\165\x70\x6c\x6f\x61\144\163\x2f\x64\x6f\x63\165\155\145\156\x74\x73\x2f{$filename}"); if (File::exists($fullImgPath)) { Document::find($data_id)->update(array("\146\x69\154\145" => NULL)); File::delete($fullImgPath); } } elseif ($data_from == "\x44\x79\156\141\155\151\143\x53\x65\x63\x74\x69\x6f\x6e") { $fullImgPath = base_path("\x70\x75\142\154\151\x63\57\x75\x70\154\157\x61\x64\x73\57\x64\x79\156\x61\155\x69\x63\x2d\x73\145\143\164\151\x6f\156\163\x2f{$filename}"); if (File::exists($fullImgPath)) { DynamicSection::find($data_id)->update(array("\151\x6d\x61\147\x65" => NULL)); File::delete($fullImgPath); } } elseif ($data_from == "\x43\141\164\145\147\157\x72\151\145\163") { $fullImgPath = base_path("\160\165\x62\154\x69\x63\57\165\x70\154\x6f\x61\x64\163\x2f\x63\x61\164\x65\x67\x6f\162\151\x65\x73\x2f{$filename}"); if (File::exists($fullImgPath)) { ContentCategory::find($data_id)->update(array("\x69\155\x61\x67\x65" => NULL)); File::delete($fullImgPath); } } elseif ($data_from == "\120\x72\157\x6a\145\x63\164\163\107\141\x6c\x6c\x65\162\171") { $project = Project::find($data_id); $toarray = json_decode($project->gallery, true); $fullImgPath = base_path("\160\165\142\154\x69\143\57\165\160\x6c\157\x61\x64\x73\x2f\160\162\x6f\x6a\145\143\x74\x73\x2f{$filename}"); if (File::exists($fullImgPath)) { File::delete($fullImgPath); $search = array($filename); $result = array_diff($toarray, $search); $newgallery = json_encode($result); Project::find($data_id)->update(array("\x67\141\154\x6c\x65\162\x79" => $newgallery)); Session::flash("\163\165\x63\x63\x65\163\163", "\122\145\x73\151\x6d\x20\142\x61\xc5\237\141\162\304\xb1\x79\154\141\40\x73\x69\154\151\156\x64\151\x2e"); } } elseif ($data_from == "\123\145\x72\x76\151\143\145\x73\x47\x61\154\154\145\x72\171") { $project = Service::find($data_id); $toarray = json_decode($project->gallery, true); $fullImgPath = base_path("\x70\165\142\x6c\151\143\x2f\165\x70\154\x6f\141\144\x73\x2f\x73\145\162\166\x69\143\145\x73\57{$filename}"); if (File::exists($fullImgPath)) { File::delete($fullImgPath); $search = array($filename); $result = array_diff($toarray, $search); $newgallery = json_encode($result); Service::find($data_id)->update(array("\x67\x61\154\x6c\x65\x72\171" => $newgallery)); Session::flash("\x73\165\x63\x63\145\163\163", "\122\x65\163\151\x6d\x20\142\x61\xc5\x9f\x61\x72\304\xb1\x79\154\141\x20\163\151\154\x69\x6e\x64\151\x2e"); } } elseif ($data_from == "\104\171\156\141\155\x69\x63\x53\x65\143\x74\x69\157\x6e\x47\x61\154\x6c\145\x72\171") { $project = DynamicSection::find($data_id); $toarray = json_decode($project->gallery, true); $fullImgPath = base_path("\x70\x75\142\154\x69\143\x2f\x75\x70\154\157\x61\144\x73\x2f\144\171\156\141\155\151\143\x2d\x73\145\143\164\151\157\x6e\163\57{$filename}"); if (File::exists($fullImgPath)) { File::delete($fullImgPath); $search = array($filename); $result = array_diff($toarray, $search); $newgallery = json_encode($result); DynamicSection::find($data_id)->update(array("\147\x61\154\x6c\145\162\171" => $newgallery)); Session::flash("\x73\x75\x63\x63\x65\163\x73", "\122\145\x73\151\155\40\x62\141\305\237\141\162\304\xb1\x79\x6c\141\x20\163\151\154\151\156\144\151\56"); } } } }

Function Calls

None

Variables

None

Stats

MD5 ef86072f2488b2bbb350b3424d8928f0
Eval Count 0
Decode Time 70 ms