Laravel Documents
環境設定
・php -v PHP 8.1.6
・composer -V Composer version 2.4.2
・git 0-version git version 2.37.1.windows.1
Creating a Laravel application
terminal
laravel new hello_laravel_heroku
cd hello_laravel_heroku
Initializing a Git repository
terminal
git init
git add .
git commit -m "new laravel project"
Deploying to Heroku
Creating a Procfile
terminal
echo "web: vendor/bin/heroku-php-apache2 public/" > Procfile
git add .
git commit -m "Procfile for Heroku"
Creating a new application on Heroku
terminal
heroku create
Setting a Laravel encryption key
terminal
php artisan key:generate --show
base64:(コード)
heroku config:set APP_KEY=base64:(コード)
Pushing to Heroku
terminal
git push heroku master
heroku open
Complete Deploy
#Best Practices
Changing the log destination for production
terminal
DBの設定
terminal
heroku addons:create cleardb:ignite
terminal
// windows
heroku config | findstr CLEARDB_DATABASE_URL
mysql://(コード)
heroku config:set DATABASE_URL='mysql://(コード)'
heroku config:set DB_CONNECTION=mysql