Skip to content

Instantly share code, notes, and snippets.

@davidmyersdev
Last active March 2, 2017 15:44
Show Gist options
  • Save davidmyersdev/b3d180d8fc2c469eba42ce470d49869d to your computer and use it in GitHub Desktop.
Save davidmyersdev/b3d180d8fc2c469eba42ce470d49869d to your computer and use it in GitHub Desktop.
Scripts and Tips to help with your Laravel project workflow.

Laravel Helpers

Project Setup

Composer Commands

Commands to help the project setup process.

By adding the following script to your composer.json, running composer install will automatically create your .env file and generate a new app key if the file doesn't exist yet (this now runs after the install, because artisan doesn't work until the packages are installed).

{
    "scripts": {
        "post-install-cmd": [
            "php -r \"if (!file_exists('./.env')) { copy('./.env.example', './.env'); exec('php artisan key:generate'); }\""
        ]
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment