LoginSignup
1
2

More than 3 years have passed since last update.

Laravel6 on Google App EngineでVue.jsを使った認証を実装する

Posted at

の続きです。

$ composer require laravel/ui --dev
$ php artisan ui vue --auth
$ npm install && npm run dev

.gcloudignorenode_modulesを追加します。

# This file specifies files that are *not* uploaded to Google Cloud Platform
# using gcloud. It follows the same syntax as .gitignore, with the addition of
# "#!include" directives (which insert the entries of the given .gitignore-style
# file at that point).
#
# For more information, run:
#   $ gcloud topic gcloudignore
#
.gcloudignore
# If you would like to upload your .git directory, .gitignore file or files
# from your .gitignore file, remove the corresponding line
# below:
.git
.gitignore

# PHP Composer dependencies:
/vendor/

.env
/node_modules/

app.yamlに静的ファイルの設定を追加します。
今回はスタンダード環境にデプロイすることにしました。

app.yaml
runtime: php72

handlers:
  - url: /css
    static_dir: public/css
  - url: /js
    static_dir: public/js

env_variables:
  ## Put production environment variables here.
  APP_KEY: YOUR_APP_KEY
  APP_STORAGE: /tmp
  VIEW_COMPILED_PATH: /tmp
  CACHE_DRIVER: database
  SESSION_DRIVER: database
  QUEUE_CONNECTION: database
  ## Set these environment variables according to your CloudSQL configuration.
  DB_DATABASE: YOUR_DB_DATABASE
  DB_USERNAME: YOUR_DB_USERNAME
  DB_PASSWORD: YOUR_DB_PASSWORD
  DB_SOCKET: "/cloudsql/YOUR_CONNECTION_NAME"
$ gcloud app deploy

スクリーンショット 2020-01-06 14.27.36.png

ユーザ登録すると、usersテーブルにデータが格納されることを確認出来ました:beer:
デプロイする前にローカル環境でCSSとJSのコンパイルが必要なのが面倒なところです(もしかしてデプロイコマンドに含めることが出来るのかな)

1
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
2