Coder Social home page Coder Social logo

heroku-isbn-books's Introduction

Laravel-Isbn


設置方法

01. Herokuアカウントを作成

https://signup.heroku.com/login

02. Herokuアプリケーションを作成

https://dashboard.heroku.com/new-app

03. Heroku CLIをインストール

https://cli-assets.heroku.com/heroku-x64.exe

04. リポジトリの clone

# clone先ディレクトリは任意(apacheのドキュメントルート配下は避ける)
$ cd /PATH/TO/LARAVELISBN

# フォルダ名は任意(アプリ名に合わせるか、複数設置したときに区別しやすいもの)
$ git clone https://github.com/YA-androidapp/Heroku-Isbn-Comics books

05. clone したリポジトリのディレクトリで composer を実行

$ cd books
$ composer install

06. データベースを設定

06.1. PoetgreSQLアドオンを追加

HerokuアプリケーションのResourceタブで Heroku Postgres を検索して追加

06.2. PoetgreSQL で、データベースとユーザーを作成

DBeaver 推奨

07. 環境変数を設定

07.1. データベースの接続情報を設定

HerokuアプリケーションのSettingsからReveal Config Varsを開く。 Heroku PostgresアドオンのSettingsのView Credentialsを参考に以下の環境変数を設定

  • DATABASE_URL
  • DB_CONNECTION pgsql
  • DB_DATABASE
  • DB_HOST
  • DB_PASSWORD
  • DB_USERNAME
  • DEBUGBAR_ENABLED true
  • LOG_CHANNEL errorlog

07.2. データベースの動作確認

$ heroku pg:psql DATABASE_URL

07.3. APP_KEYを設定

$ heroku config:set APP_KEY=$(php artisan key:generate --show)

08. マイグレーションの実行

$ heroku run php artisan migrate

既存DBからデータをインポートした場合はincrementをきちんと動作させるために以下のSQLを実行

SELECT setval('users_id_seq', coalesce((SELECT MAX(id)+1 FROM users), 1), false);
SELECT setval('books_id_seq', coalesce((SELECT MAX(id)+1 FROM books), 1), false);

09. SSL対応

  • TrustProxies.php に以下を追記
    protected $proxies = '**';

Copyright © 2020 YA-androidapp(https://github.com/YA-androidapp) All rights reserved.

heroku-isbn-books's People

Contributors

dependabot[bot] avatar

Stargazers

Roman avatar

Watchers

James Cloos avatar YA avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.