Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

php artisan make:chart is not a recognized command #34

Closed
Eixix opened this issue Aug 9, 2021 · 7 comments
Closed

php artisan make:chart is not a recognized command #34

Eixix opened this issue Aug 9, 2021 · 7 comments

Comments

@Eixix
Copy link

Eixix commented Aug 9, 2021

When entering php artisan make:chart MyChart, the command is not recognized with the error Command "make:chart" is not defined.. The command does not appear as a possible command when using php artisan list. My composer.json looks like this:

{
    "name": "laravel/laravel",
    "type": "project",
    "description": "The Laravel Framework.",
    "keywords": [
        "framework",
        "laravel"
    ],
    "license": "MIT",
    "require": {
        "php": "^8.0",
        "ext-intl": "*",
        "ext-json": "*",
        "ext-pdo": "*",
        "arielmejiadev/larapex-charts": "^2.1",
        "barryvdh/laravel-dompdf": "^0.9.0",
        "beyondcode/laravel-websockets": "^1.12",
        "codezero/laravel-unique-translation": "^3.4",
        "fideloper/proxy": "^4.4",
        "fruitcake/laravel-cors": "^2.0",
        "grkamil/laravel-telegram-logging": "^v1.4.2",
        "guzzlehttp/guzzle": "^7.1.0",
        "laravel-arcanist/arcanist": "^0.3.0",
        "laravel/framework": "^8.6",
        "laravel/telescope": "^4.4",
        "laravel/tinker": "^2.4",
        "laravel/ui": "^3.0",
        "league/flysystem-sftp": "~1.0",
        "maatwebsite/excel": "^3.1",
        "predis/predis": "^1.1",
        "sopamo/laravel-filepond": "^0.6.1",
        "spatie/laravel-backup": "^7.5",
        "spatie/laravel-menu": "^3.6",
        "spatie/laravel-sluggable": "^2.6",
        "spatie/laravel-translatable": "^4.6",
        "spatie/menu": "^2.8",
        "tymon/jwt-auth": "^1.0"
    },
    "require-dev": {
        "barryvdh/laravel-ide-helper": "^2.7",
        "facade/ignition": "^2.3.7",
        "fzaninotto/faker": "^1.9.1",
        "imanghafoori/laravel-microscope": "dev-master",
        "laravel/dusk": "^6.10.0",
        "matt-allan/laravel-code-style": "^0.6.0",
        "mockery/mockery": "^1.4.0",
        "mrclay/shibalike": "^1.0",
        "nunomaduro/collision": "^5.0",
        "phpunit/phpunit": "^9.3"
    },
    "config": {
        "optimize-autoloader": true,
        "preferred-install": "dist",
        "sort-packages": true
    },
    "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"
        ],
        "check-style": "php-cs-fixer fix --dry-run --diff",
        "fix-style": "php-cs-fixer fix"
    }
}
@hubatruck
Copy link

Hi,

Does the file under app/Console/Commands/ChartMakeCommand.php exist?
If no, this might be caused because you didn't publish the config using the following command:

php artisan vendor:publish --tag=larapex-charts-config

If it is there, the command php artisan make:chart should be registered otherwise.

@ArielMejiaDev
Copy link
Owner

Check that you have in your project the command in app/Console/Commands/ChartMakeCommand.php and check that you have the stubs in the base project directory with chart stubs.

@Eixix
Copy link
Author

Eixix commented Aug 30, 2021

Hey, even after publishing the config file, there is still no command file :(

@hubatruck
Copy link

hubatruck commented Aug 30, 2021

For some reasons, with your composer.json configuration the command indeed does not get published, just the config file.
I think the following workaround should fix your issue:

 php artisan vendor:publish --provider="ArielMejiaDev\LarapexCharts\LarapexChartsServiceProvider"

This hopefully will copy everything the package publishes.
If it still does not work, make sure you have the latest version installed of larapex-charts, and try again that way.

@Eixix
Copy link
Author

Eixix commented Sep 1, 2021

Sorry bad news. Even with this command it does not work. The output is:

Copied Directory [/vendor/arielmejiadev/larapex-charts/public] To [/public/vendor/larapex-charts]
Copied Directory [/vendor/arielmejiadev/larapex-charts/resources/views] To [/resources/views/vendor/larapex-charts]
Publishing complete.

@hubatruck
Copy link

Yes, the output is like that, but it should publish the command and the stubs too in the background.

// Publishing commands
(new Filesystem)->copyDirectory(__DIR__.'/../stubs/Console/Commands', app_path('Console/Commands'));
// Publishing stubs
(new Filesystem)->copyDirectory(__DIR__.'/../stubs/stubs', base_path('stubs'));

Please make sure, you have version 3.0.0 or greater installed, as in prior versions (2.x) this referenced code isn't present see here, thus the package does not publish the command.

@Eixix
Copy link
Author

Eixix commented Sep 1, 2021

Allright, that was totally my fault for installing the wrong version in the first place. Many thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants