2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Laravel ログイン、ログアウトによって表示を変更させる方法

Posted at

ログイン時は、マイページやログアウトを表示させたく、
ログアウト時では、ユーザー登録やログインを表示させる方法を解説します。

// @guest @endguestで挟むとログアウト時のみ表示される
@guest 
    <li class="nav-item">
      <a class="nav-link" href="">ログイン</a>
    </li>
@endguest 
      
// @auth @endauthで挟むとログイン時のみ表示される
@auth
    <li class="nav-item">
      <a class="nav-link" href=""><i class="fas fa-pen mr-1"></i>投稿する</a>
    </li>
@endauth

簡単ですね、以上です:relaxed:

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?