title: Heroku 403 Forbidden - Laravel 5
body: <p>I have a Laravel 5.8 site </p>
  
  <p><a href="https://boss-security-2.herokuapp.com/" rel="noreferrer">https://boss-security-2.herokuapp.com/</a></p>
  
  <p>I deployed to Heorku to test with this script that I created </p>
  
  <pre><code>appName='boss-security-2'
  echo 'appName =' $appName
  
  
  # heroku apps
  # heroku apps:destroy appName --confirm appName
  # ----------------------
  
  echo web: vendor/bin/heroku-php-apache2 public/ &gt; Procfile
  git init
  git status
  git add -A
  git commit -m "Initial commit"
  
  heroku create $appName
  heroku git:remote -a $appName
  heroku buildpacks:set heroku/php
  heroku config:set APP_KEY=9O7AegDFJhVC16jLfNNepT7TEQ7FyFZc
  
  git push heroku master
  
  heroku apps:info
  heroku open
  echo "done"
  #
  </code></pre>
  
  <hr>
  
  <p>I kept getting </p>
  
  <h1>Forbidden</h1>
  
  <p>></p>
  
  <blockquote>
    <p>You don't have permission to access this resource</p>
  </blockquote>
  
  <hr>
  
  <p>Anything <strong>wrong</strong> in my script ? </p>
  
  <hr>
  
  <h1>Composer.json</h1>
  
  <pre><code>{
      "name": "laravel/laravel",
      "type": "project",
      "description": "The Laravel Framework.",
      "keywords": [
          "framework",
          "laravel"
      ],
      "license": "MIT",
      "require": {
          "php": "^7.1.3",
          "fideloper/proxy": "^4.0",
          "guzzlehttp/guzzle": "~6.0",
          "laravel/framework": "5.8.*",
          "laravel/tinker": "^1.0",
          "laravelcollective/html": "~5.0",
          "nesbot/carbon": "^2.19",
          "pusher/pusher-php-server": "^3.4"
      },
      "require-dev": {
          "beyondcode/laravel-dump-server": "^1.0",
          "filp/whoops": "^2.0",
          "fzaninotto/faker": "^1.4",
          "mockery/mockery": "^1.0",
          "nunomaduro/collision": "^2.0",
          "phpunit/phpunit": "^7.5"
      },
      "config": {
          "optimize-autoloader": true,
          "preferred-install": "dist",
          "sort-packages": true
      },
      "extra": {
          "laravel": {
              "dont-discover": []
          }
      },
      "autoload": {
          "psr-4": {
              "App\\": "app/"
          },
          "classmap": [
              "database/seeds",
              "database/factories"
          ]
      },
      "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"
          ],
          "post-install-cmd": [
              "php artisan clear-compiled",
              "chmod -R 777 public/"
          ]
      },
  
  }
  </code></pre>
  
  <hr>
  
  <h1>Update 1</h1>
  
  <p>I checked the log, I saw this </p>
  
  <blockquote>
    <p>Cannot serve directory /app/: No matching DirectoryIndex (index.php,index.html,index.htm) found, and server-generated directory index forbidden by Options directive</p>
  </blockquote>
  
  <hr>
  
  <h1>Update 2</h1>
  
  <p>I have no idea why my <code>composer.json</code> in my dyno doesn't seem to have my <strong>latest</strong> code. I SSHed in and check. </p>
  
  <blockquote>
    <p><code>heroku ps:exec</code></p>
  </blockquote>
  
  <p>Is this has something to do with my <code>composer.lock</code> ?</p>