!C99Shell v. 2.5 [PHP 8 Update] [24.05.2025]!

Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 

uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 

uid=33(www-data) gid=33(www-data) groups=33(www-data) 

Safe-mode: OFF (not secure)

/var/www/html/queuepro/vendor/spatie/laravel-ignition/src/Solutions/SolutionProviders/   drwxrwxr-x
Free 12.93 GB of 57.97 GB (22.31%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     UnknownValidationSolutionProvider.php (2.46 KB)      -rwxrwxr-x
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php

namespace Spatie\LaravelIgnition\Solutions\SolutionProviders;

use 
BadMethodCallException;
use 
Illuminate\Support\Collection;
use 
Illuminate\Support\Str;
use 
Illuminate\Validation\Validator;
use 
ReflectionClass;
use 
ReflectionMethod;
use 
Spatie\Ignition\Contracts\BaseSolution;
use 
Spatie\Ignition\Contracts\HasSolutionsForThrowable;
use 
Spatie\LaravelIgnition\Support\StringComparator;
use 
Throwable;

class 
UnknownValidationSolutionProvider implements HasSolutionsForThrowable
{
    protected const 
REGEX '/Illuminate\\\\Validation\\\\Validator::(?P<method>validate(?!(Attribute|UsingCustomRule))[A-Z][a-zA-Z]+)/m';

    public function 
canSolve(Throwable $throwable): bool
    
{
        if (! 
$throwable instanceof BadMethodCallException) {
            return 
false;
        }

        return ! 
is_null($this->getMethodFromExceptionMessage($throwable->getMessage()));
    }

    public function 
getSolutions(Throwable $throwable): array
    {
        return [
            
BaseSolution::create()
                ->
setSolutionTitle('Unknown Validation Rule')
                ->
setSolutionDescription($this->getSolutionDescription($throwable)),
        ];
    }

    protected function 
getSolutionDescription(Throwable $throwable): string
    
{
        
$method = (string)$this->getMethodFromExceptionMessage($throwable->getMessage());

        
$possibleMethod StringComparator::findSimilarText(
            
$this->getAvailableMethods()->toArray(),
            
$method
        
);

        if (empty(
$possibleMethod)) {
            return 
'';
        }

        
$rule Str::snake(str_replace('validate'''$possibleMethod));

        return 
"Did you mean `{$rule}` ?";
    }

    protected function 
getMethodFromExceptionMessage(string $message): ?string
    
{
        if (! 
preg_match(self::REGEX$message$matches)) {
            return 
null;
        }

        return 
$matches['method'];
    }

    protected function 
getAvailableMethods(): Collection
    
{
        
$class = new ReflectionClass(Validator::class);

        
$extensions Collection::make((app('validator')->make([], []))->extensions)
            ->
keys()
            ->
map(fn (string $extension) => 'validate'.Str::studly($extension));

        return 
Collection::make($class->getMethods())
            ->
filter(fn (ReflectionMethod $method) => preg_match('/(validate(?!(Attribute|UsingCustomRule))[A-Z][a-zA-Z]+)/'$method->name))
            ->
map(fn (ReflectionMethod $method) => $method->name)
            ->
merge($extensions);
    }
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0055 ]--