CrestApps / laravel-code-generator

An efficient Laravel code generator, saving time by automating the creation of resources such as views, controllers, routes, migrations, languages, and form-requests. Highly flexible and customizable, it includes a cross-browser compatible template and client-side validation for application modernization.
https://laravel-code-generator.crestapps.com
MIT License
738 stars 158 forks source link

SqlServerParser.php does not comply with psr-4 autoloading standard in Crestapps #170

Closed dror-avigdor closed 3 years ago

dror-avigdor commented 3 years ago

Environment:

Description:

Class CrestApps\CodeGenerator\DatabaseParser\SqlServerParser located in C:/xampp/htdocs/cn/vendor/crestapps/laravel-code-generator/src\DatabaseParsers\SqlServerParser.php does not comply with psr-4 autoloading standard. Skipping. -- Message displayed when trying to require CrestApps in a newly created Laravel project.

Steps/Commands To Reproduce:

Content Of The Resource-File:

SqlServerParser.php: ` namespace CrestApps\CodeGenerator\DatabaseParser;

use App; use CrestApps\CodeGenerator\Models\Field; use CrestApps\CodeGenerator\Models\FieldOptimizer; use CrestApps\CodeGenerator\Support\DatabaseParser\ParserBase; use DB; use Exception;

class SqlServerParser extends ParserBase { /**

composer.json: { "name": "laravel/laravel", "type": "project", "description": "The Laravel Framework.", "keywords": [ "framework", "laravel" ], "license": "MIT", "require": { "php": "^7.3|^8.0", "fideloper/proxy": "^4.4", "fruitcake/laravel-cors": "^2.0", "guzzlehttp/guzzle": "^7.0.1", "laravel/framework": "^8.12", "laravel/tinker": "^2.5", "laravel/ui": "^3.1" }, "require-dev": { "crestapps/laravel-code-generator": "^2.4", "facade/ignition": "^2.5", "fakerphp/faker": "^1.9.1", "mockery/mockery": "^1.4.2", "nunomaduro/collision": "^5.0", "phpunit/phpunit": "^9.3.3" }, "config": { "optimize-autoloader": true, "preferred-install": "dist", "sort-packages": true }, "extra": { "laravel": { "dont-discover": [] } }, "autoload": { "psr-4": { "App\\": "app/", "Database\\Factories\\": "database/factories/", "Database\\Seeders\\": "database/seeders/" } }, "autoload-dev": { "psr-4": { "Tests\\": "tests/" } }, "minimum-stability": "dev", "prefer-stable": true, "scripts": { "post-autoload-dump": [ "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump", "@php artisan package:discover --ansi" ], "post-root-package-install": [ "@php -r \"file_exists('.env') || copy('.env.example', '.env');\"" ], "post-create-project-cmd": [ "@php artisan key:generate --ansi" ] } }

dror-avigdor commented 3 years ago

Issue solved: due to Composer ver 2 changes as regards to psr-4 autoloading standards, had to change the SqlServerParser.php file as follows: namespace CrestApps\CodeGenerator\DatabaseParser;

change to: namespace crestapps\laravelCodeGenerator\src\DatabaseParser;