Laravel - Creating tables dynamically (without migration)

前端 未结 2 1629
悲&欢浪女
悲&欢浪女 2021-02-07 11:50

I\'m trying to create a table dynamically upon an admin request, and while it seems all fun and dandy like in most of Laravel\'s documentation, I can\'t seem to create

2条回答
  •  梦如初夏
    2021-02-07 12:22

    This one is even better.

    use Illuminate\Database\Schema\Blueprint;
    use Illuminate\Support\Facades\Schema;
    
    Schema::create('tableName', function (Blueprint $table) {
            $table->increments('id');
            $table->timestamps();
        });
    

提交回复
热议问题