!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/Migrations/   drwxrwxrwx
Free 13.14 GB of 57.97 GB (22.67%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


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

use 
Illuminate\Contracts\Support\Arrayable;
use 
Illuminate\Support\Arr;

/**
 * Class RulesParser
 * @package Prettus\Repository\Generators\Migrations
 * @author Anderson Andrade <contato@andersonandra.de>
 */
class RulesParser implements Arrayable
{

    
/**
     * The set of rules.
     *
     * @var string
     */
    
protected $rules;


    
/**
     * Create new instance.
     *
     * @param string|null $rules
     */
    
public function __construct($rules null)
    {
        
$this->rules $rules;
    }

    
/**
     * Convert string migration to array.
     *
     * @return array
     */
    
public function toArray()
    {
        return 
$this->parse($this->rules);
    }

    
/**
     * Parse a string to array of formatted rules.
     *
     * @param  string $rules
     *
     * @return array
     */
    
public function parse($rules)
    {
        
$this->rules $rules;
        
$parsed = [];
        foreach (
$this->getRules() as $rulesArray) {
            
$column $this->getColumn($rulesArray);
            
$attributes $this->getAttributes($column$rulesArray);
            
$parsed[$column] = $attributes;
        }

        return 
$parsed;
    }

    
/**
     * Get array of rules.
     *
     * @return array
     */
    
public function getRules()
    {
        if (
is_null($this->rules)) {
            return [];
        }

        return 
explode(','str_replace(' '''$this->rules));
    }

    
/**
     * Get column name from rules.
     *
     * @param  string $rules
     *
     * @return string
     */
    
public function getColumn($rules)
    {
        return 
Arr::first(explode('=>'$rules), function ($key$value) {
            return 
$value;
        });
    }


    
/**
     * Get column attributes.
     *
     * @param  string $column
     * @param  string $rules
     *
     * @return array
     */
    
public function getAttributes($column$rules)
    {

        return 
str_replace($column '=>'''$rules);
    }

}

:: 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.0129 ]--