<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之旅 廣告
                1.創建遷移文件。 ``` php artisan module:make-migration create_auths_table AuthAdmin ``` ![](https://img.kancloud.cn/67/a1/67a1ab1c72b7c775e4683e7e5d026494_573x347.png) ![](https://img.kancloud.cn/09/6b/096b74cb309d0b2a64d459ace8993acd_1039x281.png) 2.創建后臺管理員相關表。 ``` <?php use Illuminate\Support\Facades\Schema; use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Migrations\Migration; class CreateAuthsTable extends Migration { public function up() { Schema::create('auth_admins', function (Blueprint $table) { //$table->comment = '管理員表'; $table->increments('id')->comment('管理員ID'); $table->string('name',100)->default('')->comment('名稱'); $table->string('phone',100)->default('')->comment('電話'); $table->string('username',50)->unique()->default('')->comment('賬號'); $table->string('password')->default('')->comment('密碼'); $table->integer('group_id')->nullable()->comment('權限組ID'); $table->tinyInteger('status')->default(1)->comment('狀態:0=禁用,1=啟用'); $table->integer('province_id')->nullable()->comment('省ID'); $table->string('province_name',30)->default('')->comment('省名稱'); $table->integer('city_id')->nullable()->comment('市'); $table->string('city_name',30)->default('')->comment('市名稱'); $table->integer('county_id')->nullable()->comment('區/縣ID'); $table->string('county_name',30)->default('')->comment('區/縣名稱'); $table->string('address')->default('')->comment('詳細地址'); $table->string('lat',30)->default('')->comment('精度'); $table->string('lng',30)->default('')->comment('緯度'); $table->decimal('money',8,2)->default('0.00')->comment('剩余營業額'); $table->decimal('max_money',8,2)->default('0.00')->comment('總余營業額'); $table->integer('sort')->default(1)->comment('排序'); $table->string('api_token', 200)->unique()->nullable()->comment('api_token'); $table->timestamp('overtime_token')->nullable()->comment('token過期時間'); $table->timestamp('created_at')->nullable()->comment('創建時間'); $table->timestamp('updated_at')->nullable()->comment('更新時間'); }); Schema::create('auth_groups', function (Blueprint $table) { //$table->comment = '權限組表'; $table->increments('id')->comment('權限組ID'); $table->string('title',100)->unique()->default('')->comment('權限名稱'); $table->tinyInteger('status')->default(1)->comment('狀態:0=禁用,1=啟用'); $table->longtext('rules')->nullable()->comment('權限規則多個用|隔開'); $table->timestamp('created_at')->nullable()->comment('創建時間'); $table->timestamp('updated_at')->nullable()->comment('更新時間'); }); Schema::create('auth_rules', function (Blueprint $table) { //$table->comment = '權限表'; $table->increments('id')->comment('權限列表ID'); $table->string('href',100)->unique()->default('')->comment('路由地址'); $table->string('title',100)->default('')->comment('中文名稱'); $table->tinyInteger('status')->default(1)->comment('側邊欄顯示狀態:0=隱藏,1=顯示'); $table->tinyInteger('auth_open')->default(1)->comment('是否驗證權限:0=否,1=是'); $table->string('icon',50)->nullable()->comment('圖標'); $table->integer('pid')->default(0)->comment('父級ID'); $table->integer('sort')->default(1)->comment('排序'); $table->timestamp('created_at')->nullable()->comment('創建時間'); $table->timestamp('updated_at')->nullable()->comment('更新時間'); }); } public function down() { Schema::dropIfExists('auth_admins'); Schema::dropIfExists('auth_groups'); Schema::dropIfExists('auth_rules'); } } ``` 3.修改config/database.php ![](https://img.kancloud.cn/26/13/2613f78ca0bee839c889452bcc80f74f_1140x547.png) 4.修改.env文件。 ![](https://img.kancloud.cn/a7/4a/a74a3974922cb5022e4dcccc2c3f6b99_1185x451.png) 5.創建mysql數據庫。 ![](https://img.kancloud.cn/bb/1f/bb1f7e957ea34366df4f5d695da3f5a0_443x395.png) 6.執行遷移文件。 ``` php artisan module:migrate AuthAdmin ``` ![](https://img.kancloud.cn/d1/d3/d1d33a3966f265fb43a755b10df68cca_1028x333.png) 7.我們發現了個問題表中的字段有注釋,但是表卻沒有注釋。 ![](https://img.kancloud.cn/66/b4/66b41193a7e0636b03abb2934be4faa2_1171x435.png) 8.用composer拉取 zedisdog/laravel-schema-extend 擴展。 ~~~ composer require zedisdog/laravel-schema-extend ~~~ 9.申明依賴 (修改config->app.php->aliases) ~~~ 'aliases' => [ ... // 'Schema' => Illuminate\Support\Facades\Schema::class, 'Schema' => Jialeo\LaravelSchemaExtend\Schema::class, ], ~~~ 10.使用(默認創建的migration文件對應的“Schema”還是引用的laravel自帶的,需要修改為該組件包的引用) ~~~ //use Illuminate\Support\Facades\Schema; use Jialeo\LaravelSchemaExtend\Schema; Schema::create('users', function (Blueprint $table) { $table->comment = '用戶表'; }); ~~~ 11.完成。 ![](https://img.kancloud.cn/c2/e5/c2e558fc07f67fb4594381381df2d2cf_1022x552.png) 視頻鏈接 ```[youku] XNDU0MDIxMTQ2NA ```
                  <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>

                              哎呀哎呀视频在线观看