John Davidson

laravel - "php artisan myCommand" handling the post-install-cmd event returned with error code 1

0 comments
Message:


I creaded a console command that will setup the database automatically based on user input and I added that command in post-install-cmd but when i run the composer install command it return error code 1.


If i run the command manually like php artisan setupDB it work, I dont know what is the issue.


May be I am adding my command in wrong script event!


This is my script section of composer.json file.


"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"
],
"post-install-cmd": [
"Illuminate\\Foundation\\ComposerScripts::postUpdate",
"php artisan setupDb",
"php artisan optimize"
]
}

This is the error SS.




My Answer:
Laravel is a popular open-source PHP framework used for building web applications. It follows the MVC (Model-View-Controller) architectural pattern and provides a wide range of features and tools to make development easier and more efficient. Some of the key features of Laravel include a powerful ORM (Object-Relational Mapping) system, routing, authentication, caching, and more. It also has a vibrant community and extensive documentation, making it a popular choice for developers.

Rate this post

5 of 5 based on 8599 votes

Comments




© 2024 Hayatsk.info - Personal Blogs Platform. All Rights Reserved.
Create blog  |  Privacy Policy  |  Terms & Conditions  |  Contact Us