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

                ??碼云GVP開源項目 12k star Uniapp+ElementUI 功能強大 支持多語言、二開方便! 廣告
                【】這是一個簡單頁面的實現: ![](https://box.kancloud.cn/3edac361eb640ea12f0227594123bd34_1519x717.png) 【】下面是一個提取數據庫資料的例子: ![](https://box.kancloud.cn/d969430bc9ad6feec4aed77014d2d664_1753x985.png) 【】以下是用factories/ModelFactory.php隨機創建20篇文章,其中title為6個單詞的句子,content為10個句子。 ~~~ factory(App\Post::class, 20)->create(); //create();直接寫入數據庫,make();打印在命令行界面 ~~~ ![](https://box.kancloud.cn/ccde543a14904ffba195466970e15093_1832x967.jpg) 【】實現分頁功能,文章只顯示100個字符: ![](https://box.kancloud.cn/16a596655f984679840a420346c1903a_1816x939.jpg) 【】顯示數據庫資料的menu過程: ![](https://box.kancloud.cn/e082979c1b055014cd057175e9413312_1863x992.png) 【頁面輸入數據到數據庫】 route.php `Route::post('/posts', 'PostController@store');` PostController.php ~~~ public function store() { //提交數據到post表中 $post = Post::create(request(['title', 'content'])); return redirect("/posts"); } ~~~ Model.php ~~~ <?php namespace App; use Illuminate\Database\Eloquent\Model as BaseModel; //表 => posts class Model extends BaseModel { protected $guarded = []; //不可以注入的字段 } ~~~ 【創建數據案例】 PostController.php ~~~ //創建邏輯 public function store() { //驗證:檢查輸入的資料 $this->validate(request(),[ 'title' => 'required|string|max:100|min:5', 'content' => 'required|string|min:10', ],[ 'title.min' => '文章標題過短', ]); //邏輯:提交數據到post表中 $post = Post::create(request(['title', 'content'])); //渲染:顯示或者跳轉 return redirect("/posts"); } ~~~ create.blade.php ~~~ @extends("layout.main") @section("content") <div class="col-sm-8 blog-main"> <form action="/posts" method="POST"> {{csrf_field()}} <!-- <input type="hidden" name="_token" value="{{csrf_token()}}" /> --> <div class="form-group"> <label>標題</label> <input name="title" type="text" class="form-control" placeholder="這里是標題"> </div> <div class="form-group"> <label>內容</label> <textarea id="content" style="height:400px;max-height:500px;" name="content" class="form-control" placeholder="這里是內容"></textarea> </div> @if(count($errors) > 0) <div class="alert alert-danger" role="alert"> @foreach($errors->all() as $error) <li>{{$error}}</li> @endforeach </div> @endif <button type="submit" class="btn btn-default">提交</button> </form> <br> </div><!-- /.blog-main --> @endsection ~~~
                  <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>

                              哎呀哎呀视频在线观看