LoginSignup
0
0

More than 1 year has passed since last update.

Fortifyのマルチドメインの時にサブドメ使いたい時のメモ

Posted at

実装は以下を参考に

adminモデルを追加してサブドメイン(admin)で制御しようとして、
ルーティングがFortifyのlogin(POST)ルートに飛んで、adminで登録してる情報でバリデートしてくれない…
ということがあったので、そのメモ(いずれ書き直す)

config/fortify.php内のdomainをサブドメインなしのドメインにして、fortifyの範囲を制御するで対応してみた

config/fortify.php
    /*
    |--------------------------------------------------------------------------
    | Fortify Routes Prefix / Subdomain
    |--------------------------------------------------------------------------
    |
    | Here you may specify which prefix Fortify will assign to all the routes
    | that it registers with the application. If necessary, you may change
    | subdomain under which all of the Fortify routes will be available.
    |
    */

    'prefix' => '',

    // 'domain' => null,
    // 以下のようにしてみた
    'domain' => env('DOMAIN', 'localhost'),

なお、コメントアウト部分の英語は以下(Google翻訳)

ここで、Fortifyがすべてのルートに割り当てるプレフィックスを指定できます
アプリケーションに登録すること。 必要に応じて、変更することができます
すべてのFortifyルートが利用できるサブドメイン。

prefixwebといれたら、localhost/web/loginとなる
(ルート名の接頭辞だったらこっち使うのにな)

0
0
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
0
0