Skip to content

Instantly share code, notes, and snippets.

@danieltorscho
Created January 31, 2019 22:57
Show Gist options
  • Save danieltorscho/b058ee363b96684e1e7d40d6ac8c17fb to your computer and use it in GitHub Desktop.
Save danieltorscho/b058ee363b96684e1e7d40d6ac8c17fb to your computer and use it in GitHub Desktop.
Dynamically create a database.sqlite within composer project
"scripts": {
"post-root-package-install": [
"php -r \"file_exists('.env') || copy('.env.example', '.env');\"",
"php -r \"file_exists('database/database.sqlite') || fopen('database/database.sqlite', 'w');\""
],
"post-create-project-cmd": [
"php artisan key:generate"
],
"post-install-cmd": [
"Illuminate\\Foundation\\ComposerScripts::postInstall",
"php -r \"file_exists('.env') || copy('.env.example', '.env');\"",
"php artisan optimize"
],
"post-update-cmd": [
"Illuminate\\Foundation\\ComposerScripts::postUpdate",
"php -r \"file_exists('database/database.sqlite') || fopen('database/database.sqlite', 'w');\"",
"php artisan ide-helper:generate",
"php artisan ide-helper:meta",
"php artisan optimize"
]
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment