id(); $table->unsignedBigInteger('business_id'); $table->string('type'); $table->date('month'); $table->unsignedInteger('amount'); $table->unsignedInteger('fee')->default(0); $table->unsignedInteger('duration'); $table->unsignedInteger('cost')->storedAs('fee*duration'); $table->unsignedFloat('tax', 8, 2)->storedAs('(cost/100)*9'); $table->json('additional')->nullable(); $table->timestamp('created_at')->nullable(); $table->timestamp('updated_at')->useCurrent(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('costs'); } }