laravel在控制器中动态创建数据表

Schema::connection('usertable')->create('test', function ($table) {
         $table->increments('id');
         $table->string('name');
 });

  

'usertable'自己配置的数据库名称。
'test'要创建的数据表名称
posted @ 2018-04-03 11:22  生如逆旅,一苇以航  阅读(1162)  评论(0编辑  收藏  举报