app/Console/Commands/CreateNewApiCommand.php
/**
     * Execute the console command.
     *
     * @return mixed
     */
Execute the console command.
@return mixed
Execute the console command . @return mixed
public function handle()
    {
        $api = $this->argument('apiName');
        if ($this->files->exists(app_path('API/'.$api))) {
            $this->error('The API already exists!');
            return false;
        }
        $this->files->makeDirectory(app_path('API/'.$api.'/Controllers'), 0777, true, true);
        $this->files->put(app_path('API/'.$api.'/routes.php'), $this->buildRoutes());
        $this->files->put(app_path('API/'.$api.'/Controllers/'.$api.'Controller.php'), $this->buildClass($api));
    }
public function handle ( ) { $ api = $ this -> argument ( 'apiName' ) ; if ( $ this -> files -> exists ( app_path ( 'API/' . $ api ) ) ) { $ this -> error ( 'The API already exists!' ) ; return false ; } $ this -> files -> makeDirectory ( app_path ( 'API/' . $ api . '/Controllers' ) , 0777 , true , true ) ; $ this -> files -> put ( app_path ( 'API/' . $ api . '/routes.php' ) , $ this -> buildRoutes ( ) ) ; $ this -> files -> put ( app_path ( 'API/' . $ api . '/Controllers/' . $ api . 'Controller.php' ) , $ this -> buildClass ( $ api ) ) ; }
Execute the console command.
Execute the console command .