<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                # 20. CURD 實踐之用 username 來代替 email 登錄 現在的登錄頁面是這樣的: ![](https://box.kancloud.cn/88e1c0750e9baeb4e0d8eeec39d37adc_2364x782.png) 填上正確的 `email` 和 `密碼` 就可以登錄。 現在我們需要用之前創建的 `username` 代替 `email` 來登錄。 第一步是先來改 view。 找到登錄頁面的 view 文件:`resources/views/auth/login.blade.php`。 再找到下面這部分: ``` <div class="form-group{{ $errors->has('email') ? ' has-error' : '' }}"> <label for="email" class="col-md-4 control-label">E-Mail Address</label> <div class="col-md-6"> <input id="email" type="email" class="form-control" name="email" value="{{ old('email') }}" required autofocus> @if ($errors->has('email')) <span class="help-block"> <strong>{{ $errors->first('email') }}</strong> </span> @endif </div> </div> ``` 把它改一下,改成下面這樣: ``` <div class="form-group{{ $errors->has('username') ? ' has-error' : '' }}"> <label for="username" class="col-md-4 control-label">UserName</label> <div class="col-md-6"> <input id="username" type="text" class="form-control" name="username" value="{{ old('username') }}" required autofocus> @if ($errors->has('username')) <span class="help-block"> <strong>{{ $errors->first('username') }}</strong> </span> @endif </div> </div> ``` 改了 view 還不夠,還要再改一個地方: 第二步,找到 `app/Http/Controllers/Auth/LoginController.php` 文件,打開之后,添加下面這個方法: ``` public function username() { return 'username'; } ``` 最終的效果: ![](https://box.kancloud.cn/1970f590de6f8d6a0f20412c38291ad5_2618x1006.gif)
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看