Q:

Where do I place my php artisan seed command in composer.json?

I'm trying to run php artisan db:seed in my Laravel application so that it runs on deployment (using Bamboo.)
Which command should it fall under?
I currently have:
"post-create-project-cmd": [
    "php artisan key:generate"
    "php artisan db:seed --force"
]

But it doesn't work. I think I'm missing something because there doesn't seem to be many questions about this.

A:

Composer has hooks to run script at these events:

before and after install
before and after update
before and after status
before and after archive
before and after dumping the autoloader
after root package installation in create-project
after create-project

None of this applies to your case.
create-project should only ever be called when a new project is started from scratch. This isn't likely for your question. You already have a working project, create-project, if it had been called, is long ago, or maybe you even started with composer require laravel/something.
post-create-project-cmd is the wrong hook, you are not calling composer create-project in Bamboo, are you?
The only hooks that may apply are those called when composer install is called. But you shouldn't attach creating an environment key to this command, because it will always be run - which seems to be not a good idea:

When you first create your Laravel application, key:generate is automatically called.
So it should already be set for you.
If you change it by executing the command again, be aware that passwords saved with Hash::make() will no longer be valid. Source

I cannot decide whether seeding the database every time you run composer install is a good idea, but it doesn't sound like it is.
What you have is the Bamboo server with a job that deals with your project. You should add every needed script to the Bamboo job to initialize an environment where you can do things - like run the tests, or even deploy to production. But this is not the scope of Composer, and you should not try to abuse it for this task.
Deployment to production uses Composer for one step: Grabbing dependencies and create the autoloader. The deployment usually does more things, so it is a script that is calling composer install when appropriate. This script should also check whether it should create a key or seed the database.

